summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorSergey Vlasov <sigprof@gmail.com>2020-10-27 02:40:59 +0300
committerDrashna Jael're <drashna@live.com>2021-01-12 22:43:33 -0800
commit0928d032137883e471c1889e42fa97d716b9cc62 (patch)
tree13e069e0e93ea0fc7ac0d81e9eddc49839bed7d2 /tmk_core
parent6edb0047326c278e4d36e7e3d495019abac948c0 (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.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h
index bc62ebf26a..4157906544 100644
--- a/tmk_core/protocol/usb_descriptor.h
+++ b/tmk_core/protocol/usb_descriptor.h
@@ -63,6 +63,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
@@ -80,7 +85,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;
@@ -148,6 +153,7 @@ enum usb_interfaces {
#ifndef KEYBOARD_SHARED_EP
KEYBOARD_INTERFACE,
#else
+ SHARED_INTERFACE,
# define KEYBOARD_INTERFACE SHARED_INTERFACE
#endif
@@ -162,7 +168,7 @@ enum usb_interfaces {
MOUSE_INTERFACE,
#endif
-#ifdef SHARED_EP_ENABLE
+#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP)
SHARED_INTERFACE,
#endif