Closed nopnop2002 closed 2 years ago
In fact, there is no issue here as when you enter in one of the sleep mode the interrupt are disabled. https://github.com/stm32duino/STM32LowPower/blob/c2e8d13dd777808d7d588d56621ce0ad8fab77fd/src/low_power.c#L259
For IDLE mode the systick is simply disabled: https://github.com/stm32duino/STM32LowPower/blob/c2e8d13dd777808d7d588d56621ce0ad8fab77fd/src/low_power.c#L234-L239
As millis relies on the systick it is normal it is not incremented during the sleep. You can use the RTC to compensate it if you need.
My Envitonment
STM32F103(8MHz Xtal) + platformIO
My config
My code
Problem
millis() does not return the correct time. idle can stop the clock.
Screen Shot