Skip to content

Commit

Permalink
fix: Sleep after clearing endpoints to wait for send.
Browse files Browse the repository at this point in the history
* Add a small sleep to allow other threads to send data for the
  endpoint clearing before sleep.
  • Loading branch information
petejohanson committed Dec 31, 2023
1 parent 85f0d23 commit 28b69c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 28b69c0

Please sign in to comment.