cpu/stm32f0: fixed low-level timer driver

This commit is contained in:
Hauke Petersen
2014-11-06 17:23:26 +01:00
parent b501eb86cb
commit 19a95bbfbe
2 changed files with 6 additions and 3 deletions
-1
View File
@@ -69,5 +69,4 @@ unsigned long hwtimer_arch_now(void)
void irq_handler(int channel)
{
timeout_handler((short)(channel));
thread_yield();
}
+6 -2
View File
@@ -22,13 +22,14 @@
#include "cpu.h"
#include "board.h"
#include "sched.h"
#include "thread.h"
#include "periph_conf.h"
#include "periph/timer.h"
/* guard file in case no TIMER devices are defined */
#if TIMER_0_EN || TIMER_1_EN
static inline void irq_handler(tim_t timer, TIM_TypeDef *dev);
typedef struct {
@@ -38,7 +39,7 @@ typedef struct {
/**
* Timer state memory
*/
timer_conf_t config[TIMER_NUMOF];
static timer_conf_t config[TIMER_NUMOF];
int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
@@ -326,5 +327,8 @@ static inline void irq_handler(tim_t timer, TIM_TypeDef *dev)
dev->SR &= ~TIM_SR_CC4IF;
config[timer].cb(3);
}
if (sched_context_switch_request) {
thread_yield();
}
}
#endif /* TIMER_0_EN || TIMER_1_EN */