aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/Kconfig5
-rw-r--r--app/src/activity.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/app/Kconfig b/app/Kconfig
index 0e761bed72..3a70f294aa 100644
--- a/app/Kconfig
+++ b/app/Kconfig
@@ -387,13 +387,12 @@ config ZMK_IDLE_TIMEOUT
config ZMK_SLEEP
bool "Enable deep sleep support"
+ depends on HAS_POWEROFF
+ select POWEROFF
imply USB
if ZMK_SLEEP
-config PM_DEVICE
- default y
-
config ZMK_IDLE_SLEEP_TIMEOUT
int "Milliseconds of inactivity before entering deep sleep"
default 900000
diff --git a/app/src/activity.c b/app/src/activity.c
index 330008b3e4..1140915168 100644
--- a/app/src/activity.c
+++ b/app/src/activity.c
@@ -7,7 +7,7 @@
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <zephyr/kernel.h>
-#include <zephyr/pm/pm.h>
+#include <zephyr/sys/poweroff.h>
#include <zephyr/logging/log.h>
@@ -70,7 +70,7 @@ void activity_work_handler(struct k_work *work) {
if (inactive_time > MAX_SLEEP_MS && !is_usb_power_present()) {
// Put devices in suspend power mode before sleeping
set_state(ZMK_ACTIVITY_SLEEP);
- pm_state_force(0U, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
+ sys_poweroff();
} else
#endif /* IS_ENABLED(CONFIG_ZMK_SLEEP) */
if (inactive_time > MAX_IDLE_MS) {