apache / mynewt-core

An OS to build, deploy and securely manage billions of devices
https://mynewt.apache.org/
Apache License 2.0
825 stars 369 forks source link

stm32f1/rtc_tick: Fix tick interrupt generation #3242

Closed kasjer closed 3 months ago

kasjer commented 3 months ago

When RTC (STM32F1 specific only) was used as os tick source. If OS requested longer tickles time RTC alarm was set to some time in the future. After WFI finished RTC periodic tick interrupt was not enabled. If then some task took more time and periodically checked time, time would never advance due to RTC tick interrupt being disabled. Time would advance only in idle task. Now normal tick is working all the time unless there is nothing to do and after WFI finishes tick is enabled again.