feat(pm): Clear HID data before soft off.
* Make sure the connected host has no held HID usages before we sleep.
This commit is contained in:
parent
860e53b33a
commit
0d4d4fb2b5
1 changed files with 6 additions and 0 deletions
|
@ -13,6 +13,8 @@
|
||||||
#include <zephyr/logging/log.h>
|
#include <zephyr/logging/log.h>
|
||||||
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
|
||||||
|
|
||||||
|
#include <zmk/endpoints.h>
|
||||||
|
|
||||||
#define HAS_WAKERS DT_HAS_COMPAT_STATUS_OKAY(zmk_soft_off_wakeup_sources)
|
#define HAS_WAKERS DT_HAS_COMPAT_STATUS_OKAY(zmk_soft_off_wakeup_sources)
|
||||||
|
|
||||||
#if HAS_WAKERS
|
#if HAS_WAKERS
|
||||||
|
@ -29,6 +31,10 @@ int zmk_pm_soft_off(void) {
|
||||||
size_t device_count;
|
size_t device_count;
|
||||||
const struct device *devs;
|
const struct device *devs;
|
||||||
|
|
||||||
|
#if !IS_ENABLED(CONFIG_ZMK_SPLIT) || IS_ENABLED(CONFIG_ZMK_SPLIT_ROLE_CENTRAL)
|
||||||
|
zmk_endpoints_clear_current();
|
||||||
|
#endif
|
||||||
|
|
||||||
device_count = z_device_get_all_static(&devs);
|
device_count = z_device_get_all_static(&devs);
|
||||||
|
|
||||||
// There may be some matrix/direct kscan devices that would be used for wakeup
|
// There may be some matrix/direct kscan devices that would be used for wakeup
|
||||||
|
|
Loading…
Add table
Reference in a new issue