fix(usb): detect USB power mode to fallback to BLE

* Add tracking to see if we ever hit a configured status before
  suspend, so we can properly track "is connected" even when
  connected to a suspended/asleep host.
This commit is contained in:
angweekiat 2024-10-15 07:15:45 +08:00 committed by GitHub
parent 6cbf25f04a
commit 0adb80c02b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -24,6 +24,4 @@ enum zmk_usb_conn_state zmk_usb_get_conn_state(void);
static inline bool zmk_usb_is_powered(void) {
return zmk_usb_get_conn_state() != ZMK_USB_CONN_NONE;
}
static inline bool zmk_usb_is_hid_ready(void) {
return zmk_usb_get_conn_state() == ZMK_USB_CONN_HID;
}
bool zmk_usb_is_hid_ready(void);