-
Notifications
You must be signed in to change notification settings - Fork 55
Description
The STM32L071 has 5 low-power modes: Low-power Run, Sleep, Low-power Sleep, Stop, and Standby. The STM32LowPower library only has 4 modes: Idle, Sleep, DeepSleep, and Shutdown. The code's comments are not consistent in describing what STM mode corresponds to what library mode, leading to confusion on which should be used. I had thought I had found bugs in the library code until I realized it was the comments that were incorrect which had led me to invoke the wrong functions.
In STM32LowPower.cpp:
Line 63 says that Idle = STM Sleep
Line 77 says that Sleep = STM Sleep, conflicting with Idle
Line 91 says that DeepSleep = STM Stop
Line 105 says that Shutdown = STM Standby
Line 128 says that Idle = STM Sleep and Sleep = STM Stop, conflicting with the prior description of Stop
Line 131 says that DeepSleep = STM Standby, which conflicts with the prior description of DeepSleep
If the comments could be revised to clarify these issues it would be appreciated. Note that none of these descriptions claim to invoke Low-power Run or Low-Power sleep, so these descriptions link 4 Arduino functions to only 3 of the 5 STM low-power functions.