Skip to content

Commit

Permalink
cpu/stm32f3: Update to match timer_init API change
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Feb 13, 2016
1 parent e43f503 commit 5ab8485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpu/stm32f3/periph/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef struct {
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;

Expand Down Expand Up @@ -67,7 +67,7 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
timer->CR2 = 0;

/* set auto-reload and prescaler values and load new values */
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 */
Expand Down

0 comments on commit 5ab8485

Please sign in to comment.