chip/stm32: Add explanation for previous STOP mode bug.
Commit fixed a bug in STOP
mode. This commit adds more explanation of what was happening.
BRANCH=none
TEST=none
*/
#define LPTIM_PRESCALER_LOG2 2
/*
- * LPTIM_PRESCALER and LPTIM_PERIOD_US have to be signed, because we compare
- * them to an int to decide whether to go to deep sleep. Simply using BIT()
- * makes them unsigned, which causes a bug in deep sleep behavior.
- * TODO(b/140538084): Explain exactly what the bug is.
+ * LPTIM_PRESCALER and LPTIM_PERIOD_US have to be signed, because they
+ * determine the signedness of the comparison with |next_delay| in
+ * __idle(), where |next_delay| is negative if no next event.
*/
#define LPTIM_PRESCALER ((int)BIT(LPTIM_PRESCALER_LOG2))
#define LPTIM_PERIOD_US (SECOND / (STM32_LSI_CLOCK / LPTIM_PRESCALER))
