diff options
author | Sergey Vlasov <sigprof@gmail.com> | 2020-10-27 02:40:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-27 10:40:59 +1100 |
commit | f149c07d68c3819e26198f8d4f97857de3a1c78e (patch) | |
tree | dee62de284da4da23d51790df1417c54de8b9364 /tmk_core | |
parent | 2c92ee1f56b92b15403b2f070c827162db37c9ba (diff) |
Fix KEYBOARD_SHARED_EP incompatibility with VIA (#9930)
The `KEYBOARD_SHARED_EP=yes` option was breaking the VIA support,
because the raw HID interface number in this case was 0 instead of 1,
and the VIA app depends on the exact interface number for raw HID.
Change the interface ordering to put the shared interface before the raw
HID interface if `KEYBOARD_SHARED_EP` is enabled, so that the raw HID
interface can keep its number.
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/protocol/usb_descriptor.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 79dd87014f..02a4b1ce59 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -60,6 +60,11 @@ typedef struct { USB_Descriptor_Interface_t Keyboard_Interface; USB_HID_Descriptor_HID_t Keyboard_HID; USB_Descriptor_Endpoint_t Keyboard_INEndpoint; +#else + // Shared Interface + USB_Descriptor_Interface_t Shared_Interface; + USB_HID_Descriptor_HID_t Shared_HID; + USB_Descriptor_Endpoint_t Shared_INEndpoint; #endif #ifdef RAW_ENABLE @@ -77,7 +82,7 @@ typedef struct { USB_Descriptor_Endpoint_t Mouse_INEndpoint; #endif -#ifdef SHARED_EP_ENABLE +#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) // Shared Interface USB_Descriptor_Interface_t Shared_Interface; USB_HID_Descriptor_HID_t Shared_HID; @@ -139,6 +144,7 @@ enum usb_interfaces { #ifndef KEYBOARD_SHARED_EP KEYBOARD_INTERFACE, #else + SHARED_INTERFACE, # define KEYBOARD_INTERFACE SHARED_INTERFACE #endif @@ -153,7 +159,7 @@ enum usb_interfaces { MOUSE_INTERFACE, #endif -#ifdef SHARED_EP_ENABLE +#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) SHARED_INTERFACE, #endif |