aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa/lufa.c
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-01-12 12:22:06 +1100
committerDrashna Jaelre <drashna@live.com>2019-01-11 17:22:05 -0800
commit2c4109394fa9ee71b10b8b2d3d1473a409d7003e (patch)
tree4f6ea100fa29543981051035e30147cd6d72dbd1 /tmk_core/protocol/lufa/lufa.c
parentd9c5e5870efe730af52688b9a268927872f93eb7 (diff)
downloadqmk_firmware-2c4109394fa9ee71b10b8b2d3d1473a409d7003e.tar.gz
qmk_firmware-2c4109394fa9ee71b10b8b2d3d1473a409d7003e.zip
Fix Caps Lock LEDs once and for all (#4824)
* Check the size of the SET_REPORT packet If we have two bytes, that probably means the first is a report ID. The 6KRO interface may or may not have one, but the NKRO interface always does, so we need to check this regardless of whether KEYBOARD_SHARED_EP is defined. * Fix indentation
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
-rw-r--r--tmk_core/protocol/lufa/lufa.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 27cf51b16..cdabaf16e 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -517,17 +517,20 @@ void EVENT_USB_Device_ControlRequest(void)
517 if (USB_DeviceState == DEVICE_STATE_Unattached) 517 if (USB_DeviceState == DEVICE_STATE_Unattached)
518 return; 518 return;
519 } 519 }
520#ifdef KEYBOARD_SHARED_EP 520
521 uint8_t report_id = REPORT_ID_KEYBOARD; 521 if (Endpoint_BytesInEndpoint() == 2) {
522 if (keyboard_protocol) { 522 uint8_t report_id = REPORT_ID_KEYBOARD;
523 report_id = Endpoint_Read_8(); 523
524 } 524 if (keyboard_protocol) {
525 if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) { 525 report_id = Endpoint_Read_8();
526 }
527
528 if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) {
526 keyboard_led_stats = Endpoint_Read_8(); 529 keyboard_led_stats = Endpoint_Read_8();
530 }
531 } else {
532 keyboard_led_stats = Endpoint_Read_8();
527 } 533 }
528#else
529 keyboard_led_stats = Endpoint_Read_8();
530#endif
531 534
532 Endpoint_ClearOUT(); 535 Endpoint_ClearOUT();
533 Endpoint_ClearStatusStage(); 536 Endpoint_ClearStatusStage();