aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/src/activity.c
diff options
context:
space:
mode:
authorNick Winans <[email protected]>2022-05-06 13:14:23 -0500
committerPete Johanson <[email protected]>2022-05-17 00:30:47 -0400
commit54747a52f909a80c92ddbd1a2fe99d2f32766a90 (patch)
tree93669517dc66b64119c6ec91ec4e3fb652d14b9b /app/src/activity.c
parentd7ba7a1bee1931de7a3c0f8442c53b75aac18dac (diff)
downloadzmk-54747a52f909a80c92ddbd1a2fe99d2f32766a90.tar.gz
zmk-54747a52f909a80c92ddbd1a2fe99d2f32766a90.zip
fix(sleep): use pm_power_state_force for proper device power management
Diffstat (limited to 'app/src/activity.c')
-rw-r--r--app/src/activity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/activity.c b/app/src/activity.c
index 469ccdf73a..5a1e238539 100644
--- a/app/src/activity.c
+++ b/app/src/activity.c
@@ -68,9 +68,9 @@ void activity_work_handler(struct k_work *work) {
int32_t inactive_time = current - activity_last_uptime;
#if IS_ENABLED(CONFIG_ZMK_SLEEP)
if (inactive_time > MAX_SLEEP_MS && !is_usb_power_present()) {
- // Put devices in low power mode before sleeping
+ // Put devices in suspend power mode before sleeping
set_state(ZMK_ACTIVITY_SLEEP);
- pm_power_state_set((struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
+ pm_power_state_force(0U, (struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
} else
#endif /* IS_ENABLED(CONFIG_ZMK_SLEEP) */
if (inactive_time > MAX_IDLE_MS) {