Skip to content

Commit f1e3784

Browse files
jurenatkartben
authored andcommitted
soc: st: stm32: poweroff uses stm32_wkup_pins
Update the poweroff code to use stm32_pwr_wkup_pin_cfg_pupd if enabled. Signed-off-by: Tomáš Juřena <[email protected]>
1 parent 067126a commit f1e3784

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

soc/st/stm32/stm32c0x/poweroff.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
11
/*
22
* Copyright (c) 2024 Kickmaker
3+
* Copyright (c) 2025 Tomas Jurena
4+
*
35
* SPDX-License-Identifier: Apache-2.0
46
*/
57

68
#include <zephyr/kernel.h>
79
#include <zephyr/sys/poweroff.h>
810
#include <zephyr/toolchain.h>
11+
#include <zephyr/drivers/misc/stm32_wkup_pins/stm32_wkup_pins.h>
912

1013
#include <stm32_ll_cortex.h>
1114
#include <stm32_ll_pwr.h>
15+
#include <stm32_ll_system.h>
1216

1317
void z_sys_poweroff(void)
1418
{
19+
#ifdef CONFIG_STM32_WKUP_PINS
20+
stm32_pwr_wkup_pin_cfg_pupd();
21+
22+
LL_PWR_ClearFlag_WU();
23+
#endif /* CONFIG_STM32_WKUP_PINS */
24+
1525
LL_PWR_SetPowerMode(LL_PWR_MODE_SHUTDOWN);
1626
LL_LPM_EnableDeepSleep();
27+
LL_DBGMCU_DisableDBGStandbyMode();
1728

1829
k_cpu_idle();
1930

0 commit comments

Comments
 (0)