소스 검색

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.
fauxpark 6 년 전
부모
커밋
ae79b60e6b
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      tmk_core/protocol/lufa/lufa.c

+ 1 - 5
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();