stm32-rs / stm32f1xx-hal

A Rust embedded-hal HAL impl for the STM32F1 family based on japarics stm32f103xx-hal
Apache License 2.0
550 stars 173 forks source link

Bugfix: `CounterHz` and `Counter` `wait` #449

Closed AndreySmirnov81 closed 1 year ago

AndreySmirnov81 commented 1 year ago

CounterHz and Counter do not wait properly after the second and subsequent start.

burrbull commented 1 year ago

It is strange. trigger_update should not cause interrupt.

https://github.com/stm32-rs/stm32f1xx-hal/blob/cafbac16d79da5c56bedb99b8c3f45b2c2463c38/src/timer.rs#L374-L379

Maybe wait doesn't clear flag correctly?

AndreySmirnov81 commented 1 year ago

wait clears the flag correctly, however, the timer does not stop and works cyclically, which leads to the fact that the TIMx_SR.UIF flag is constantly set.

burrbull commented 1 year ago

bors r+

bors[bot] commented 1 year ago

Build succeeded: