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.
This commit is contained in:
		| @@ -60,6 +60,11 @@ typedef struct { | |||||||
|     USB_Descriptor_Interface_t Keyboard_Interface; |     USB_Descriptor_Interface_t Keyboard_Interface; | ||||||
|     USB_HID_Descriptor_HID_t   Keyboard_HID; |     USB_HID_Descriptor_HID_t   Keyboard_HID; | ||||||
|     USB_Descriptor_Endpoint_t  Keyboard_INEndpoint; |     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 | #endif | ||||||
|  |  | ||||||
| #ifdef RAW_ENABLE | #ifdef RAW_ENABLE | ||||||
| @@ -77,7 +82,7 @@ typedef struct { | |||||||
|     USB_Descriptor_Endpoint_t  Mouse_INEndpoint; |     USB_Descriptor_Endpoint_t  Mouse_INEndpoint; | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef SHARED_EP_ENABLE | #if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) | ||||||
|     // Shared Interface |     // Shared Interface | ||||||
|     USB_Descriptor_Interface_t Shared_Interface; |     USB_Descriptor_Interface_t Shared_Interface; | ||||||
|     USB_HID_Descriptor_HID_t   Shared_HID; |     USB_HID_Descriptor_HID_t   Shared_HID; | ||||||
| @@ -139,6 +144,7 @@ enum usb_interfaces { | |||||||
| #ifndef KEYBOARD_SHARED_EP | #ifndef KEYBOARD_SHARED_EP | ||||||
|     KEYBOARD_INTERFACE, |     KEYBOARD_INTERFACE, | ||||||
| #else | #else | ||||||
|  |     SHARED_INTERFACE, | ||||||
| #    define KEYBOARD_INTERFACE SHARED_INTERFACE | #    define KEYBOARD_INTERFACE SHARED_INTERFACE | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| @@ -153,7 +159,7 @@ enum usb_interfaces { | |||||||
|     MOUSE_INTERFACE, |     MOUSE_INTERFACE, | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #ifdef SHARED_EP_ENABLE | #if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) | ||||||
|     SHARED_INTERFACE, |     SHARED_INTERFACE, | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user