Skip to content
Permalink
Browse files

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
  • Loading branch information
fauxpark authored and drashna committed Jan 12, 2019
1 parent d9c5e58 commit 2c4109394fa9ee71b10b8b2d3d1473a409d7003e
Showing with 12 additions and 9 deletions.
  1. +12 −9 tmk_core/protocol/lufa/lufa.c
@@ -517,17 +517,20 @@ void EVENT_USB_Device_ControlRequest(void)
if (USB_DeviceState == DEVICE_STATE_Unattached)
return;
}
#ifdef KEYBOARD_SHARED_EP
uint8_t report_id = REPORT_ID_KEYBOARD;
if (keyboard_protocol) {
report_id = Endpoint_Read_8();
}
if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) {

if (Endpoint_BytesInEndpoint() == 2) {
uint8_t report_id = REPORT_ID_KEYBOARD;

if (keyboard_protocol) {
report_id = Endpoint_Read_8();
}

if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) {
keyboard_led_stats = Endpoint_Read_8();
}
} else {
keyboard_led_stats = Endpoint_Read_8();
}
#else
keyboard_led_stats = Endpoint_Read_8();
#endif

Endpoint_ClearOUT();
Endpoint_ClearStatusStage();

0 comments on commit 2c41093

Please sign in to comment.