From e427caaf01da0c1e39c794e6cdb09eaac5093903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sun, 4 Oct 2015 00:22:49 +0200 Subject: [PATCH] cpu/stm32f0: Update to match timer_init API change --- cpu/stm32f0/periph/timer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/stm32f0/periph/timer.c b/cpu/stm32f0/periph/timer.c index 8f6f146862..f6fc9608af 100644 --- a/cpu/stm32f0/periph/timer.c +++ b/cpu/stm32f0/periph/timer.c @@ -42,7 +42,7 @@ typedef struct { static timer_conf_t config[TIMER_NUMOF]; -int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int)) +int timer_init(tim_t dev, unsigned long freq, void (*callback)(int)) { TIM_TypeDef *timer; @@ -80,7 +80,7 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int)) /* set auto-reload and prescaler values and load new values */ timer->ARR = TIMER_0_MAX_VALUE; - timer->PSC = TIMER_0_PRESCALER * ticks_per_us; + timer->PSC = (TIMER_0_FREQ / freq) - 1; timer->EGR |= TIM_EGR_UG; /* enable the timer's interrupt */