diff --git a/soc/st/stm32/stm32c0x/poweroff.c b/soc/st/stm32/stm32c0x/poweroff.c index c9c4db49e9d..ec07aaf81bf 100644 --- a/soc/st/stm32/stm32c0x/poweroff.c +++ b/soc/st/stm32/stm32c0x/poweroff.c @@ -1,19 +1,30 @@ /* * Copyright (c) 2024 Kickmaker + * Copyright (c) 2025 Tomas Jurena + * * SPDX-License-Identifier: Apache-2.0 */ #include #include #include +#include #include #include +#include void z_sys_poweroff(void) { +#ifdef CONFIG_STM32_WKUP_PINS + stm32_pwr_wkup_pin_cfg_pupd(); + + LL_PWR_ClearFlag_WU(); +#endif /* CONFIG_STM32_WKUP_PINS */ + LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN); LL_LPM_EnableDeepSleep(); + LL_DBGMCU_DisableDBGStandbyMode(); k_cpu_idle();