]> git.donarmstrong.com Git - tmk_firmware.git/commitdiff
NKRO is disable when SET_PROTOCOL(boot)
authortmk <nobody@nowhere>
Sat, 26 Apr 2014 20:07:27 +0000 (05:07 +0900)
committertmk <nobody@nowhere>
Sat, 26 Apr 2014 20:36:41 +0000 (05:36 +0900)
- Command can force to enable NKRO even when boot mode
- After boot keyboard may be in boot mode due to BIOS' request

common/action_util.c
protocol/lufa/lufa.c
protocol/pjrc/usb.c
protocol/pjrc/usb_keyboard.c

index ebe7150dcc13eadef09a651b9f6b1f79b6171e83..99a3adaab63fc2cf8f61fc17c49557d742932622 100644 (file)
@@ -67,7 +67,7 @@ void send_keyboard_report(void) {
 void add_key(uint8_t key)
 {
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro && keyboard_protocol) {
+    if (keyboard_nkro) {
         add_key_bit(key);
         return;
     }
@@ -78,7 +78,7 @@ void add_key(uint8_t key)
 void del_key(uint8_t key)
 {
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro && keyboard_protocol) {
+    if (keyboard_nkro) {
         del_key_bit(key);
         return;
     }
@@ -151,7 +151,7 @@ uint8_t has_anymod(void)
 uint8_t get_first_key(void)
 {
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro && keyboard_protocol) {
+    if (keyboard_nkro) {
         uint8_t i = 0;
         for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
             ;
index a43a552a81b06a80d6421f19c9ece69ca029ee3d..db05702aa773415e35da26ec4bd5cc7fb973038b 100644 (file)
@@ -308,6 +308,9 @@ void EVENT_USB_Device_ControlRequest(void)
                     Endpoint_ClearStatusStage();
 
                     keyboard_protocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00);
+#ifdef NKRO_ENABLE
+                    keyboard_nkro = !!keyboard_protocol;
+#endif
                     clear_keyboard();
                 }
             }
@@ -354,7 +357,7 @@ static void send_keyboard(report_keyboard_t *report)
 
     /* Select the Keyboard Report Endpoint */
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro && keyboard_protocol) {
+    if (keyboard_nkro) {
         /* Report protocol - NKRO */
         Endpoint_SelectEndpoint(NKRO_IN_EPNUM);
 
index b09ad3f233ffa82b5c80108bb2509db02540197b..2b267d48004199e581aa16bce0bf53656eda3cfd 100644 (file)
@@ -930,6 +930,9 @@ ISR(USB_COM_vect)
                                }
                                if (bRequest == HID_SET_PROTOCOL) {
                                        keyboard_protocol = wValue;
+#ifdef NKRO_ENABLE
+                                        keyboard_nkro = !!keyboard_protocol;
+#endif
                                         clear_keyboard();
                                        //usb_wait_in_ready();
                                        usb_send_in();
index c11995db6f7a7adf80e9d3a6ceef23d00c38fede..d168331879f840fb9285cb01be1e22d17515949f 100644 (file)
@@ -56,7 +56,7 @@ int8_t usb_keyboard_send_report(report_keyboard_t *report)
     int8_t result = 0;
 
 #ifdef NKRO_ENABLE
-    if (keyboard_nkro && keyboard_protocol)
+    if (keyboard_nkro)
         result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE);
     else
 #endif