qmk

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/qmk.git
Log | Files | Refs | Submodules | LICENSE

commit ae79b60e6bfc03c7fa84076e508f0f2241f087c2
parent 8cf7265f8fae6f94b17c5d78ed41e52b22e2b218
Author: fauxpark <fauxpark@gmail.com>
Date:   Tue, 22 Jan 2019 21:43:17 +1100

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:
tmk_core/protocol/lufa/lufa.c | 6+-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c @@ -519,11 +519,7 @@ void EVENT_USB_Device_ControlRequest(void) } if (Endpoint_BytesInEndpoint() == 2) { - uint8_t report_id = REPORT_ID_KEYBOARD; - - if (keyboard_protocol) { - report_id = Endpoint_Read_8(); - } + uint8_t report_id = Endpoint_Read_8(); if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) { keyboard_led_stats = Endpoint_Read_8();