diff options
| -rw-r--r-- | common/action_util.c | 6 | ||||
| -rw-r--r-- | protocol/lufa/lufa.c | 5 | ||||
| -rw-r--r-- | protocol/pjrc/usb.c | 3 | ||||
| -rw-r--r-- | protocol/pjrc/usb_keyboard.c | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/common/action_util.c b/common/action_util.c index ebe7150dc..99a3adaab 100644 --- a/common/action_util.c +++ b/common/action_util.c | |||
| @@ -67,7 +67,7 @@ void send_keyboard_report(void) { | |||
| 67 | void add_key(uint8_t key) | 67 | void add_key(uint8_t key) |
| 68 | { | 68 | { |
| 69 | #ifdef NKRO_ENABLE | 69 | #ifdef NKRO_ENABLE |
| 70 | if (keyboard_nkro && keyboard_protocol) { | 70 | if (keyboard_nkro) { |
| 71 | add_key_bit(key); | 71 | add_key_bit(key); |
| 72 | return; | 72 | return; |
| 73 | } | 73 | } |
| @@ -78,7 +78,7 @@ void add_key(uint8_t key) | |||
| 78 | void del_key(uint8_t key) | 78 | void del_key(uint8_t key) |
| 79 | { | 79 | { |
| 80 | #ifdef NKRO_ENABLE | 80 | #ifdef NKRO_ENABLE |
| 81 | if (keyboard_nkro && keyboard_protocol) { | 81 | if (keyboard_nkro) { |
| 82 | del_key_bit(key); | 82 | del_key_bit(key); |
| 83 | return; | 83 | return; |
| 84 | } | 84 | } |
| @@ -151,7 +151,7 @@ uint8_t has_anymod(void) | |||
| 151 | uint8_t get_first_key(void) | 151 | uint8_t get_first_key(void) |
| 152 | { | 152 | { |
| 153 | #ifdef NKRO_ENABLE | 153 | #ifdef NKRO_ENABLE |
| 154 | if (keyboard_nkro && keyboard_protocol) { | 154 | if (keyboard_nkro) { |
| 155 | uint8_t i = 0; | 155 | uint8_t i = 0; |
| 156 | for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) | 156 | for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) |
| 157 | ; | 157 | ; |
diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index a43a552a8..db05702aa 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c | |||
| @@ -308,6 +308,9 @@ void EVENT_USB_Device_ControlRequest(void) | |||
| 308 | Endpoint_ClearStatusStage(); | 308 | Endpoint_ClearStatusStage(); |
| 309 | 309 | ||
| 310 | keyboard_protocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00); | 310 | keyboard_protocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00); |
| 311 | #ifdef NKRO_ENABLE | ||
| 312 | keyboard_nkro = !!keyboard_protocol; | ||
| 313 | #endif | ||
| 311 | clear_keyboard(); | 314 | clear_keyboard(); |
| 312 | } | 315 | } |
| 313 | } | 316 | } |
| @@ -354,7 +357,7 @@ static void send_keyboard(report_keyboard_t *report) | |||
| 354 | 357 | ||
| 355 | /* Select the Keyboard Report Endpoint */ | 358 | /* Select the Keyboard Report Endpoint */ |
| 356 | #ifdef NKRO_ENABLE | 359 | #ifdef NKRO_ENABLE |
| 357 | if (keyboard_nkro && keyboard_protocol) { | 360 | if (keyboard_nkro) { |
| 358 | /* Report protocol - NKRO */ | 361 | /* Report protocol - NKRO */ |
| 359 | Endpoint_SelectEndpoint(NKRO_IN_EPNUM); | 362 | Endpoint_SelectEndpoint(NKRO_IN_EPNUM); |
| 360 | 363 | ||
diff --git a/protocol/pjrc/usb.c b/protocol/pjrc/usb.c index b09ad3f23..2b267d480 100644 --- a/protocol/pjrc/usb.c +++ b/protocol/pjrc/usb.c | |||
| @@ -930,6 +930,9 @@ ISR(USB_COM_vect) | |||
| 930 | } | 930 | } |
| 931 | if (bRequest == HID_SET_PROTOCOL) { | 931 | if (bRequest == HID_SET_PROTOCOL) { |
| 932 | keyboard_protocol = wValue; | 932 | keyboard_protocol = wValue; |
| 933 | #ifdef NKRO_ENABLE | ||
| 934 | keyboard_nkro = !!keyboard_protocol; | ||
| 935 | #endif | ||
| 933 | clear_keyboard(); | 936 | clear_keyboard(); |
| 934 | //usb_wait_in_ready(); | 937 | //usb_wait_in_ready(); |
| 935 | usb_send_in(); | 938 | usb_send_in(); |
diff --git a/protocol/pjrc/usb_keyboard.c b/protocol/pjrc/usb_keyboard.c index c11995db6..d16833187 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) | |||
| 56 | int8_t result = 0; | 56 | int8_t result = 0; |
| 57 | 57 | ||
| 58 | #ifdef NKRO_ENABLE | 58 | #ifdef NKRO_ENABLE |
| 59 | if (keyboard_nkro && keyboard_protocol) | 59 | if (keyboard_nkro) |
| 60 | result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE); | 60 | result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE); |
| 61 | else | 61 | else |
| 62 | #endif | 62 | #endif |
