From 78192ba6e9a78e58a4ead74975ccdbc6308242f8 Mon Sep 17 00:00:00 2001 From: Alexandre Bourdiol Date: Mon, 1 Mar 2021 18:25:42 +0100 Subject: [PATCH] Restore PWR clock at wakeup This avoid to miss it in system clock configuration, as it is not systematically done by cubeMX Signed-off-by: Alexandre Bourdiol --- src/low_power.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/low_power.c b/src/low_power.c index 0dd0c2e..707fb6f 100644 --- a/src/low_power.c +++ b/src/low_power.c @@ -347,6 +347,11 @@ void LowPower_EnableWakeUpUart(serial_t *serial, void (*FuncPtr)(void)) */ WEAK void SystemClock_ConfigFromStop(void) { +#if defined(__HAL_RCC_PWR_CLK_ENABLE) + /* Enable PWR clock, needed for example: voltage scaling */ + __HAL_RCC_PWR_CLK_ENABLE(); +#endif + SystemClock_Config(); }