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.
This commit is contained in:
Peter Johanson 2023-12-31 06:36:52 +00:00 committed by Pete Johanson
parent c3144055e8
commit 09111f1cf3

View File

@ -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);