aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol/lufa/lufa.c
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-01-22 21:43:17 +1100
committerDrashna Jaelre <drashna@live.com>2019-01-22 09:30:01 -0800
commitae79b60e6bfc03c7fa84076e508f0f2241f087c2 (patch)
treee003132a05fe290a3dc52e0200f084a6d244c98d /tmk_core/protocol/lufa/lufa.c
parent8cf7265f8fae6f94b17c5d78ed41e52b22e2b218 (diff)
downloadqmk_firmware-ae79b60e6bfc03c7fa84076e508f0f2241f087c2.tar.gz
qmk_firmware-ae79b60e6bfc03c7fa84076e508f0f2241f087c2.zip
Always read two bytes from the endpoint if we have two bytes to read
When this if statement is false, it will cause the report ID to be read as the LED state. We already know there are two bytes in the endpoint, which is a reasonably good indicator that it contains a report ID, so we should always read both.
Diffstat (limited to 'tmk_core/protocol/lufa/lufa.c')
-rw-r--r--tmk_core/protocol/lufa/lufa.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index cdabaf16e..f2ecf2465 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -519,11 +519,7 @@ void EVENT_USB_Device_ControlRequest(void)
519 } 519 }
520 520
521 if (Endpoint_BytesInEndpoint() == 2) { 521 if (Endpoint_BytesInEndpoint() == 2) {
522 uint8_t report_id = REPORT_ID_KEYBOARD; 522 uint8_t report_id = Endpoint_Read_8();
523
524 if (keyboard_protocol) {
525 report_id = Endpoint_Read_8();
526 }
527 523
528 if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) { 524 if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) {
529 keyboard_led_stats = Endpoint_Read_8(); 525 keyboard_led_stats = Endpoint_Read_8();