We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6ed97ab + 633240b commit 63601dfCopy full SHA for 63601df
targets/TARGET_STM/sleep.c
@@ -52,7 +52,17 @@ void deepsleep(void)
52
53
// Request to enter STOP mode with regulator in low power mode
54
#if TARGET_STM32L4
55
- HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
+ if (__HAL_RCC_PWR_IS_CLK_ENABLED()) {
56
+ HAL_PWREx_EnableLowPowerRunMode();
57
+ HAL_PWREx_EnterSTOP2Mode(PWR_STOPENTRY_WFI);
58
+ HAL_PWREx_DisableLowPowerRunMode();
59
+ } else {
60
+ __HAL_RCC_PWR_CLK_ENABLE();
61
62
63
64
+ __HAL_RCC_PWR_CLK_DISABLE();
65
+ }
66
#else /* TARGET_STM32L4 */
67
HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
68
#endif /* TARGET_STM32L4 */
0 commit comments