summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2019-11-10 17:02:46 +0000
committerFlorian Didron <fdidron@users.noreply.github.com>2020-01-09 08:57:11 +0900
commitab609a07a63c17bbe4e55678cca148117fea9a7c (patch)
tree56d679b8691a68acfcdf4b844eb094dad0589628 /tmk_core/protocol/chibios
parent5aa1d81b15688c40ef05827eb80d40d790debd32 (diff)
Fix chibios when mouse and nkro disabled (#7312)
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r--tmk_core/protocol/chibios/usb_main.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 0acb78c9ad..b4ee55ce9f 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -409,7 +409,6 @@ static void set_led_transfer_cb(USBDriver *usbp) {
/* Callback for SETUP request on the endpoint 0 (control) */
static bool usb_request_hook_cb(USBDriver *usbp) {
const USBDescriptor *dp;
- int has_report_id;
/* usbp->setup fields:
* 0: bmRequestType (bitmask)
@@ -462,26 +461,17 @@ static bool usb_request_hook_cb(USBDriver *usbp) {
switch (usbp->setup[1]) { /* bRequest */
case HID_SET_REPORT:
switch (usbp->setup[4]) { /* LSB(wIndex) (check MSB==0 and wLength==1?) */
- case KEYBOARD_INTERFACE:
#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP)
case SHARED_INTERFACE:
+ usbSetupTransfer(usbp, set_report_buf, sizeof(set_report_buf), set_led_transfer_cb);
+ return TRUE;
+ break;
#endif
+
+ case KEYBOARD_INTERFACE:
/* keyboard_led_stats = <read byte from next OUT report>
* keyboard_led_stats needs be word (or dword), otherwise we get an exception on F0 */
- has_report_id = 0;
-#if defined(SHARED_EP_ENABLE)
- if (usbp->setup[4] == SHARED_INTERFACE) {
- has_report_id = 1;
- }
-#endif
- if (usbp->setup[4] == KEYBOARD_INTERFACE && !keyboard_protocol) {
- has_report_id = 0;
- }
- if (has_report_id) {
- usbSetupTransfer(usbp, set_report_buf, sizeof(set_report_buf), set_led_transfer_cb);
- } else {
- usbSetupTransfer(usbp, (uint8_t *)&keyboard_led_stats, 1, NULL);
- }
+ usbSetupTransfer(usbp, (uint8_t *)&keyboard_led_stats, 1, NULL);
return TRUE;
break;
}