@@ -60,55 +60,55 @@ void STM32LowPower::begin(void)
60
60
/* *
61
61
* @brief Enable the idle low power mode (STM32 sleep). Exit this mode on
62
62
* 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).
64
64
* @retval None
65
65
*/
66
- void STM32LowPower::idle (uint32_t millis )
66
+ void STM32LowPower::idle (uint32_t ms )
67
67
{
68
- if ((millis > 0 ) || _rtc_wakeup) {
69
- programRtcWakeUp (millis , IDLE_MODE);
68
+ if ((ms != 0 ) || _rtc_wakeup) {
69
+ programRtcWakeUp (ms , IDLE_MODE);
70
70
}
71
71
LowPower_sleep (PWR_MAINREGULATOR_ON);
72
72
}
73
73
74
74
/* *
75
75
* @brief Enable the sleep low power mode (STM32 sleep). Exit this mode on
76
76
* 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).
78
78
* @retval None
79
79
*/
80
- void STM32LowPower::sleep (uint32_t millis )
80
+ void STM32LowPower::sleep (uint32_t ms )
81
81
{
82
- if ((millis > 0 ) || _rtc_wakeup) {
83
- programRtcWakeUp (millis , SLEEP_MODE);
82
+ if ((ms != 0 ) || _rtc_wakeup) {
83
+ programRtcWakeUp (ms , SLEEP_MODE);
84
84
}
85
85
LowPower_sleep (PWR_LOWPOWERREGULATOR_ON);
86
86
}
87
87
88
88
/* *
89
89
* @brief Enable the deepsleep low power mode (STM32 stop). Exit this mode on
90
90
* 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).
92
92
* @retval None
93
93
*/
94
- void STM32LowPower::deepSleep (uint32_t millis )
94
+ void STM32LowPower::deepSleep (uint32_t ms )
95
95
{
96
- if ((millis > 0 ) || _rtc_wakeup) {
97
- programRtcWakeUp (millis , DEEP_SLEEP_MODE);
96
+ if ((ms != 0 ) || _rtc_wakeup) {
97
+ programRtcWakeUp (ms , DEEP_SLEEP_MODE);
98
98
}
99
99
LowPower_stop (_serial);
100
100
}
101
101
102
102
/* *
103
103
* @brief Enable the shutdown low power mode (STM32 shutdown or standby mode).
104
104
* 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).
106
106
* @retval None
107
107
*/
108
- void STM32LowPower::shutdown (uint32_t millis )
108
+ void STM32LowPower::shutdown (uint32_t ms )
109
109
{
110
- if ((millis > 0 ) || _rtc_wakeup) {
111
- programRtcWakeUp (millis , SHUTDOWN_MODE);
110
+ if ((ms != 0 ) || _rtc_wakeup) {
111
+ programRtcWakeUp (ms , SHUTDOWN_MODE);
112
112
}
113
113
LowPower_shutdown ();
114
114
}
@@ -167,11 +167,11 @@ void STM32LowPower::enableWakeupFrom(STM32RTC *rtc, voidFuncPtr callback, void *
167
167
168
168
/* *
169
169
* @brief Configure the RTC alarm
170
- * @param millis : time of the alarm in milliseconds.
170
+ * @param ms : time of the alarm in milliseconds.
171
171
* @param lp_mode: low power mode targeted.
172
172
* @retval None
173
173
*/
174
- void STM32LowPower::programRtcWakeUp (uint32_t millis , LP_Mode lp_mode)
174
+ void STM32LowPower::programRtcWakeUp (uint32_t ms , LP_Mode lp_mode)
175
175
{
176
176
int epoc;
177
177
uint32_t sec;
@@ -199,17 +199,17 @@ void STM32LowPower::programRtcWakeUp(uint32_t millis, LP_Mode lp_mode)
199
199
}
200
200
rtc.configForLowPower (clkSrc);
201
201
202
- if (millis > 0 ) {
202
+ if (ms != 0 ) {
203
203
// Convert millisecond to second
204
- sec = millis / 1000 ;
204
+ sec = ms / 1000 ;
205
205
206
206
#if defined(STM32_RTC_VERSION) && (STM32_RTC_VERSION >= 0x01010000)
207
207
uint32_t epoc_ms;
208
- millis = millis % 1000 ;
208
+ ms = ms % 1000 ;
209
209
epoc = rtc.getEpoch (&epoc_ms);
210
210
211
211
// Update epoch_ms - might need to add a second to epoch
212
- epoc_ms += millis ;
212
+ epoc_ms += ms ;
213
213
if (epoc_ms >= 1000 ) {
214
214
sec ++;
215
215
epoc_ms -= 1000 ;
0 commit comments