forked from kofal.net/zmk
feat: only send HID reports to one endpoint
Added some utility functions and an event for tracking the state of the USB connection. Updated endpoints.c to select a single endpoint to send HID reports to based on the status of the USB and BLE connections. Partially fixes #206. Future commits will add a user setting to control which endpoint is used if both USB and BLE are ready.
This commit is contained in:
@@ -23,14 +23,7 @@ static u32_t power_last_uptime;
|
||||
|
||||
bool is_usb_power_present() {
|
||||
#ifdef CONFIG_USB
|
||||
enum usb_dc_status_code usb_status = zmk_usb_get_status();
|
||||
switch (usb_status) {
|
||||
case USB_DC_DISCONNECTED:
|
||||
case USB_DC_UNKNOWN:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
return zmk_usb_is_powered();
|
||||
#else
|
||||
return false;
|
||||
#endif /* CONFIG_USB */
|
||||
|
||||
Reference in New Issue
Block a user