diff --git a/common/action_util.c b/common/action_util.c index ebe7150d..99a3adaa 100644 --- a/common/action_util.c +++ b/common/action_util.c @@ -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++) ; diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index a43a552a..db05702a 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c @@ -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); diff --git a/protocol/pjrc/usb.c b/protocol/pjrc/usb.c index b09ad3f2..2b267d48 100644 --- a/protocol/pjrc/usb.c +++ b/protocol/pjrc/usb.c @@ -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(); diff --git a/protocol/pjrc/usb_keyboard.c b/protocol/pjrc/usb_keyboard.c index c11995db..d1683318 100644 --- a/protocol/pjrc/usb_keyboard.c +++ b/protocol/pjrc/usb_keyboard.c @@ -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