@@ -110,15 +110,23 @@ void STM32LowPower::deepSleep(uint32_t ms)
110
110
* @param ms: optional delay before leave the shutdown mode (default: 0).
111
111
* @retval None
112
112
*/
113
+ #if defined(STM32WB0x)
114
+ void STM32LowPower::shutdown (void )
115
+ {
116
+ LowPower_shutdown (false );
117
+ }
118
+ #else
113
119
void STM32LowPower::shutdown (uint32_t ms)
114
120
{
115
121
if ((ms != 0 ) || _rtc_wakeup) {
116
122
programRtcWakeUp (ms, SHUTDOWN_MODE);
117
123
}
124
+
118
125
/* Get the rtc object to know if it is configured */
119
126
STM32RTC &rtc = STM32RTC::getInstance ();
120
127
LowPower_shutdown (rtc.isConfigured ());
121
128
}
129
+ #endif
122
130
123
131
/* *
124
132
* @brief Enable GPIO pin in interrupt mode. If the pin is a wakeup pin, it is
@@ -135,7 +143,11 @@ void STM32LowPower::attachInterruptWakeup(uint32_t pin, voidFuncPtrVoid callback
135
143
{
136
144
attachInterrupt (pin, callback, mode);
137
145
138
- if (LowPowerMode == SHUTDOWN_MODE) {
146
+ if ((LowPowerMode == SHUTDOWN_MODE)
147
+ #if defined(PWR_WAKEUP_PA0)
148
+ || (LowPowerMode == DEEP_SLEEP_MODE)
149
+ #endif /* PWR_WAKEUP1_SOURCE_SELECTION_0 */
150
+ ) {
139
151
// If Gpio is a Wake up pin activate it for shutdown (standby or shutdown stm32)
140
152
LowPower_EnableWakeUpPin (pin, mode);
141
153
}
@@ -192,7 +204,11 @@ void STM32LowPower::programRtcWakeUp(uint32_t ms, LP_Mode lp_mode)
192
204
break ;
193
205
// LSI or LSE must be selected as clock source to wakeup the device.
194
206
case DEEP_SLEEP_MODE:
207
+ #if defined(RCC_RTC_WDG_BLEWKUP_CLKSOURCE_HSI64M_DIV2048)
208
+ clkSrc = (clkSrc == STM32RTC::HSI_CLOCK) ? STM32RTC::LSI_CLOCK : clkSrc;
209
+ #else
195
210
clkSrc = (clkSrc == STM32RTC::HSE_CLOCK) ? STM32RTC::LSI_CLOCK : clkSrc;
211
+ #endif
196
212
break ;
197
213
default :
198
214
case SHUTDOWN_MODE:
0 commit comments