From 825b0fb5d3ca6117904b0c33ed9b97071f8b3a44 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Mon, 7 Aug 2023 18:27:57 +0200 Subject: [PATCH] samples: boards: stm32: power_mgmt: stm32wb_ble: use sys_poweroff Use sys_poweroff to power off the system. Signed-off-by: Gerard Marull-Paretas --- samples/boards/stm32/power_mgmt/stm32wb_ble/prj.conf | 2 +- samples/boards/stm32/power_mgmt/stm32wb_ble/src/main.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/samples/boards/stm32/power_mgmt/stm32wb_ble/prj.conf b/samples/boards/stm32/power_mgmt/stm32wb_ble/prj.conf index de6fe12424b..583df4e6ee7 100644 --- a/samples/boards/stm32/power_mgmt/stm32wb_ble/prj.conf +++ b/samples/boards/stm32/power_mgmt/stm32wb_ble/prj.conf @@ -1,5 +1,5 @@ CONFIG_BT=y CONFIG_BT_DEVICE_NAME="Test beacon" -CONFIG_PM=y +CONFIG_POWEROFF=y #CONFIG_DEBUG=y diff --git a/samples/boards/stm32/power_mgmt/stm32wb_ble/src/main.c b/samples/boards/stm32/power_mgmt/stm32wb_ble/src/main.c index 14688c0c400..faabd4eda30 100644 --- a/samples/boards/stm32/power_mgmt/stm32wb_ble/src/main.c +++ b/samples/boards/stm32/power_mgmt/stm32wb_ble/src/main.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -146,7 +146,8 @@ int main(void) printk("Bluetooth disable failed (err %d)\n", err); } - printk("Shutdown\n"); - pm_state_force(0u, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0}); + printk("Powering off\n"); + sys_poweroff(); + return 0; }