diff options
| author | fauxpark <fauxpark@gmail.com> | 2019-10-09 05:47:37 +1100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-10-08 11:47:37 -0700 |
| commit | 4335b97a072cef1a5814d8a07368c25fc175a93d (patch) | |
| tree | 1d7b9c2bb3b0ffc2bd278ad19ccf9e7284ea8eff /tmk_core | |
| parent | 89fe8d2d8727574f6d1fa8f56a0ab35aa4b0245c (diff) | |
| download | qmk_firmware-4335b97a072cef1a5814d8a07368c25fc175a93d.tar.gz qmk_firmware-4335b97a072cef1a5814d8a07368c25fc175a93d.zip | |
Reorder Raw HID interface to match what the USB spec expects (#6801)
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/protocol/usb_descriptor.c | 20 | ||||
| -rw-r--r-- | tmk_core/protocol/usb_descriptor.h | 16 |
2 files changed, 18 insertions, 18 deletions
diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index 7d509f4ef..ffcf0957f 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c | |||
| @@ -331,6 +331,16 @@ const USB_Descriptor_Configuration_t PROGMEM | |||
| 331 | .Keyboard_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS}, | 331 | .Keyboard_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | KEYBOARD_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = KEYBOARD_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS}, |
| 332 | #endif | 332 | #endif |
| 333 | 333 | ||
| 334 | #ifdef RAW_ENABLE | ||
| 335 | /* | ||
| 336 | * Raw HID | ||
| 337 | */ | ||
| 338 | .Raw_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = RAW_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 2, .Class = HID_CSCP_HIDClass, .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR}, | ||
| 339 | .Raw_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(RawReport)}, | ||
| 340 | .Raw_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | RAW_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = RAW_EPSIZE, .PollingIntervalMS = 0x01}, | ||
| 341 | .Raw_OUTEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_OUT | RAW_OUT_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = RAW_EPSIZE, .PollingIntervalMS = 0x01}, | ||
| 342 | #endif | ||
| 343 | |||
| 334 | #if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) | 344 | #if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) |
| 335 | /* | 345 | /* |
| 336 | * Mouse | 346 | * Mouse |
| @@ -361,16 +371,6 @@ const USB_Descriptor_Configuration_t PROGMEM | |||
| 361 | .Shared_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | SHARED_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = SHARED_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS}, | 371 | .Shared_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | SHARED_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = SHARED_EPSIZE, .PollingIntervalMS = USB_POLLING_INTERVAL_MS}, |
| 362 | #endif | 372 | #endif |
| 363 | 373 | ||
| 364 | #ifdef RAW_ENABLE | ||
| 365 | /* | ||
| 366 | * Raw HID | ||
| 367 | */ | ||
| 368 | .Raw_Interface = {.Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, .InterfaceNumber = RAW_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 2, .Class = HID_CSCP_HIDClass, .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, .InterfaceStrIndex = NO_DESCRIPTOR}, | ||
| 369 | .Raw_HID = {.Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, .HIDSpec = VERSION_BCD(1, 1, 1), .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, .HIDReportLength = sizeof(RawReport)}, | ||
| 370 | .Raw_INEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_IN | RAW_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = RAW_EPSIZE, .PollingIntervalMS = 0x01}, | ||
| 371 | .Raw_OUTEndpoint = {.Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, .EndpointAddress = (ENDPOINT_DIR_OUT | RAW_OUT_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), .EndpointSize = RAW_EPSIZE, .PollingIntervalMS = 0x01}, | ||
| 372 | #endif | ||
| 373 | |||
| 374 | #ifdef CONSOLE_ENABLE | 374 | #ifdef CONSOLE_ENABLE |
| 375 | /* | 375 | /* |
| 376 | * Console | 376 | * Console |
diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index e922edc45..b2423fa7e 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h | |||
| @@ -62,6 +62,14 @@ typedef struct { | |||
| 62 | USB_Descriptor_Endpoint_t Keyboard_INEndpoint; | 62 | USB_Descriptor_Endpoint_t Keyboard_INEndpoint; |
| 63 | #endif | 63 | #endif |
| 64 | 64 | ||
| 65 | #ifdef RAW_ENABLE | ||
| 66 | // Raw HID Interface | ||
| 67 | USB_Descriptor_Interface_t Raw_Interface; | ||
| 68 | USB_HID_Descriptor_HID_t Raw_HID; | ||
| 69 | USB_Descriptor_Endpoint_t Raw_INEndpoint; | ||
| 70 | USB_Descriptor_Endpoint_t Raw_OUTEndpoint; | ||
| 71 | #endif | ||
| 72 | |||
| 65 | #if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) | 73 | #if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) |
| 66 | // Mouse HID Interface | 74 | // Mouse HID Interface |
| 67 | USB_Descriptor_Interface_t Mouse_Interface; | 75 | USB_Descriptor_Interface_t Mouse_Interface; |
| @@ -76,14 +84,6 @@ typedef struct { | |||
| 76 | USB_Descriptor_Endpoint_t Shared_INEndpoint; | 84 | USB_Descriptor_Endpoint_t Shared_INEndpoint; |
| 77 | #endif | 85 | #endif |
| 78 | 86 | ||
| 79 | #ifdef RAW_ENABLE | ||
| 80 | // Raw HID Interface | ||
| 81 | USB_Descriptor_Interface_t Raw_Interface; | ||
| 82 | USB_HID_Descriptor_HID_t Raw_HID; | ||
| 83 | USB_Descriptor_Endpoint_t Raw_INEndpoint; | ||
| 84 | USB_Descriptor_Endpoint_t Raw_OUTEndpoint; | ||
| 85 | #endif | ||
| 86 | |||
| 87 | #ifdef CONSOLE_ENABLE | 87 | #ifdef CONSOLE_ENABLE |
| 88 | // Console HID Interface | 88 | // Console HID Interface |
| 89 | USB_Descriptor_Interface_t Console_Interface; | 89 | USB_Descriptor_Interface_t Console_Interface; |
