From 28b69c08b61deefc6bfc56c2d188ce401249190e Mon Sep 17 00:00:00 2001 From: Peter Johanson Date: Sun, 31 Dec 2023 06:36:52 +0000 Subject: [PATCH] fix: Sleep after clearing endpoints to wait for send. * Add a small sleep to allow other threads to send data for the endpoint clearing before sleep. --- app/src/pm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/pm.c b/app/src/pm.c index a4599ac8fce..8525046f049 100644 --- a/app/src/pm.c +++ b/app/src/pm.c @@ -35,6 +35,8 @@ int zmk_pm_soft_off(void) { #if !IS_ENABLED(CONFIG_ZMK_SPLIT) || IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL) zmk_endpoints_clear_current(); + // Need to sleep to give any other threads a chance so submit endpoint data. + k_sleep(K_MSEC(100)); #endif device_count = z_device_get_all_static(&devs);