File tree 3 files changed +7
-8
lines changed
3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ void send_keyboard_report(void) {
76
76
void add_key (uint8_t key )
77
77
{
78
78
#ifdef NKRO_ENABLE
79
- if (keyboard_nkro ) {
79
+ if (keyboard_protocol && keyboard_nkro ) {
80
80
add_key_bit (key );
81
81
return ;
82
82
}
@@ -87,7 +87,7 @@ void add_key(uint8_t key)
87
87
void del_key (uint8_t key )
88
88
{
89
89
#ifdef NKRO_ENABLE
90
- if (keyboard_nkro ) {
90
+ if (keyboard_protocol && keyboard_nkro ) {
91
91
del_key_bit (key );
92
92
return ;
93
93
}
@@ -160,7 +160,7 @@ uint8_t has_anymod(void)
160
160
uint8_t get_first_key (void )
161
161
{
162
162
#ifdef NKRO_ENABLE
163
- if (keyboard_nkro ) {
163
+ if (keyboard_protocol && keyboard_nkro ) {
164
164
uint8_t i = 0 ;
165
165
for (; i < KEYBOARD_REPORT_BITS && !keyboard_report -> nkro .bits [i ]; i ++ )
166
166
;
Original file line number Diff line number Diff line change @@ -315,6 +315,7 @@ static bool command_common(uint8_t code)
315
315
print_val_hex8 (host_keyboard_leds ());
316
316
print_val_hex8 (keyboard_protocol );
317
317
print_val_hex8 (keyboard_idle );
318
+ print_val_hex8 (keyboard_nkro );
318
319
print_val_hex32 (timer_count );
319
320
320
321
#ifdef PROTOCOL_PJRC
Original file line number Diff line number Diff line change 53
53
#include "lufa.h"
54
54
55
55
uint8_t keyboard_idle = 0 ;
56
+ /* 0: Boot Protocol, 1: Report Protocol(default) */
56
57
uint8_t keyboard_protocol = 1 ;
57
58
static uint8_t keyboard_led_stats = 0 ;
58
59
@@ -349,10 +350,7 @@ void EVENT_USB_Device_ControlRequest(void)
349
350
Endpoint_ClearSETUP ();
350
351
Endpoint_ClearStatusStage ();
351
352
352
- keyboard_protocol = ((USB_ControlRequest .wValue & 0xFF ) != 0x00 );
353
- #ifdef NKRO_ENABLE
354
- keyboard_nkro = !!keyboard_protocol ;
355
- #endif
353
+ keyboard_protocol = (USB_ControlRequest .wValue & 0xFF );
356
354
clear_keyboard ();
357
355
}
358
356
}
@@ -399,7 +397,7 @@ static void send_keyboard(report_keyboard_t *report)
399
397
400
398
/* Select the Keyboard Report Endpoint */
401
399
#ifdef NKRO_ENABLE
402
- if (keyboard_nkro ) {
400
+ if (keyboard_protocol && keyboard_nkro ) {
403
401
/* Report protocol - NKRO */
404
402
Endpoint_SelectEndpoint (NKRO_IN_EPNUM );
405
403
You can’t perform that action at this time.
0 commit comments