@@ -60,55 +60,55 @@ void STM32LowPower::begin(void)
6060/* *
6161 * @brief Enable the idle low power mode (STM32 sleep). Exit this mode on
6262 * interrupt or in n milliseconds.
63- * @param millis : optional delay before leave the idle mode (default: 0).
63+ * @param ms : optional delay before leave the idle mode (default: 0).
6464 * @retval None
6565 */
66- void STM32LowPower::idle (uint32_t millis )
66+ void STM32LowPower::idle (uint32_t ms )
6767{
68- if ((millis > 0 ) || _rtc_wakeup) {
69- programRtcWakeUp (millis , IDLE_MODE);
68+ if ((ms != 0 ) || _rtc_wakeup) {
69+ programRtcWakeUp (ms , IDLE_MODE);
7070 }
7171 LowPower_sleep (PWR_MAINREGULATOR_ON);
7272}
7373
7474/* *
7575 * @brief Enable the sleep low power mode (STM32 sleep). Exit this mode on
7676 * interrupt or in n milliseconds.
77- * @param millis : optional delay before leave the sleep mode (default: 0).
77+ * @param ms : optional delay before leave the sleep mode (default: 0).
7878 * @retval None
7979 */
80- void STM32LowPower::sleep (uint32_t millis )
80+ void STM32LowPower::sleep (uint32_t ms )
8181{
82- if ((millis > 0 ) || _rtc_wakeup) {
83- programRtcWakeUp (millis , SLEEP_MODE);
82+ if ((ms != 0 ) || _rtc_wakeup) {
83+ programRtcWakeUp (ms , SLEEP_MODE);
8484 }
8585 LowPower_sleep (PWR_LOWPOWERREGULATOR_ON);
8686}
8787
8888/* *
8989 * @brief Enable the deepsleep low power mode (STM32 stop). Exit this mode on
9090 * interrupt or in n milliseconds.
91- * @param millis : optional delay before leave the deepSleep mode (default: 0).
91+ * @param ms : optional delay before leave the deepSleep mode (default: 0).
9292 * @retval None
9393 */
94- void STM32LowPower::deepSleep (uint32_t millis )
94+ void STM32LowPower::deepSleep (uint32_t ms )
9595{
96- if ((millis > 0 ) || _rtc_wakeup) {
97- programRtcWakeUp (millis , DEEP_SLEEP_MODE);
96+ if ((ms != 0 ) || _rtc_wakeup) {
97+ programRtcWakeUp (ms , DEEP_SLEEP_MODE);
9898 }
9999 LowPower_stop (_serial);
100100}
101101
102102/* *
103103 * @brief Enable the shutdown low power mode (STM32 shutdown or standby mode).
104104 * Exit this mode on interrupt or in n milliseconds.
105- * @param millis : optional delay before leave the shutdown mode (default: 0).
105+ * @param ms : optional delay before leave the shutdown mode (default: 0).
106106 * @retval None
107107 */
108- void STM32LowPower::shutdown (uint32_t millis )
108+ void STM32LowPower::shutdown (uint32_t ms )
109109{
110- if ((millis > 0 ) || _rtc_wakeup) {
111- programRtcWakeUp (millis , SHUTDOWN_MODE);
110+ if ((ms != 0 ) || _rtc_wakeup) {
111+ programRtcWakeUp (ms , SHUTDOWN_MODE);
112112 }
113113 LowPower_shutdown ();
114114}
@@ -167,11 +167,11 @@ void STM32LowPower::enableWakeupFrom(STM32RTC *rtc, voidFuncPtr callback, void *
167167
168168/* *
169169 * @brief Configure the RTC alarm
170- * @param millis : time of the alarm in milliseconds.
170+ * @param ms : time of the alarm in milliseconds.
171171 * @param lp_mode: low power mode targeted.
172172 * @retval None
173173 */
174- void STM32LowPower::programRtcWakeUp (uint32_t millis , LP_Mode lp_mode)
174+ void STM32LowPower::programRtcWakeUp (uint32_t ms , LP_Mode lp_mode)
175175{
176176 int epoc;
177177 uint32_t sec;
@@ -199,17 +199,17 @@ void STM32LowPower::programRtcWakeUp(uint32_t millis, LP_Mode lp_mode)
199199 }
200200 rtc.configForLowPower (clkSrc);
201201
202- if (millis > 0 ) {
202+ if (ms != 0 ) {
203203 // Convert millisecond to second
204- sec = millis / 1000 ;
204+ sec = ms / 1000 ;
205205
206206#if defined(STM32_RTC_VERSION) && (STM32_RTC_VERSION >= 0x01010000)
207207 uint32_t epoc_ms;
208- millis = millis % 1000 ;
208+ ms = ms % 1000 ;
209209 epoc = rtc.getEpoch (&epoc_ms);
210210
211211 // Update epoch_ms - might need to add a second to epoch
212- epoc_ms += millis ;
212+ epoc_ms += ms ;
213213 if (epoc_ms >= 1000 ) {
214214 sec ++;
215215 epoc_ms -= 1000 ;
0 commit comments