littlekernel / lk

LK embedded kernel
MIT License
3.11k stars 613 forks source link

[stm32f0xx] Fix prescaler value. #264

Closed claridge closed 3 years ago

claridge commented 3 years ago

As specified in ST reference manual RM0091, the prescaling factor applied by timers is 1 plus the value in the corresponding prescaler register. (See section 17.4.11 for TIM1, and analogous sections for other timers.)

This change causes stm32_timer_capture_setup to take the prescaling factor as input rather than the register value.