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 <jurenatomas@gmail.com>
This commit is contained in:
parent
067126abcd
commit
f1e3784b9d
1 changed files with 11 additions and 0 deletions
|
@ -1,19 +1,30 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Kickmaker
|
||||
* Copyright (c) 2025 Tomas Jurena
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/sys/poweroff.h>
|
||||
#include <zephyr/toolchain.h>
|
||||
#include <zephyr/drivers/misc/stm32_wkup_pins/stm32_wkup_pins.h>
|
||||
|
||||
#include <stm32_ll_cortex.h>
|
||||
#include <stm32_ll_pwr.h>
|
||||
#include <stm32_ll_system.h>
|
||||
|
||||
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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue