cpu/stm32f0: Update to match timer_init API change
This commit is contained in:
parent
3d8c8b295d
commit
e427caaf01
@ -42,7 +42,7 @@ typedef struct {
|
|||||||
static 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))
|
int timer_init(tim_t dev, unsigned long freq, void (*callback)(int))
|
||||||
{
|
{
|
||||||
TIM_TypeDef *timer;
|
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 */
|
/* set auto-reload and prescaler values and load new values */
|
||||||
timer->ARR = TIMER_0_MAX_VALUE;
|
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;
|
timer->EGR |= TIM_EGR_UG;
|
||||||
|
|
||||||
/* enable the timer's interrupt */
|
/* enable the timer's interrupt */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user