cpu: stm32f1: fix timer auto reload value

Previously, the auto-reload register was set to TIMERx_MAXVALUE. This is
incorrect, as TIMERx combines two 16bit timers.

This commit fixes the assignment.
This commit is contained in:
Kaspar Schleiser 2015-07-30 14:32:11 +02:00
parent a134693918
commit f584bd6921

View File

@ -94,7 +94,7 @@ int timer_init(tim_t dev, unsigned int ticks_per_us, void (*callback)(int))
/* send update event as trigger output */
timer0->CR2 |= TIM_CR2_MMS_1;
/* set auto-reload and prescaler values and load new values */
timer0->ARR = TIMER_0_MAX_VALUE;
timer0->ARR = 0xFFFF;
timer0->PSC = TIMER_0_PRESCALER * ticks_per_us;
// timer->EGR |= TIM_EGR_UG;