Bläddra i källkod

NKRO is disable when SET_PROTOCOL(boot)

- Command can force to enable NKRO even when boot mode
- After boot keyboard may be in boot mode due to BIOS' request
tags/v1.9
tmk 10 år sedan
förälder
incheckning
22854eb71b
4 ändrade filer med 11 tillägg och 5 borttagningar
  1. 3
    3
      common/action_util.c
  2. 4
    1
      protocol/lufa/lufa.c
  3. 3
    0
      protocol/pjrc/usb.c
  4. 1
    1
      protocol/pjrc/usb_keyboard.c

+ 3
- 3
common/action_util.c Visa fil

void add_key(uint8_t key) void add_key(uint8_t key)
{ {
#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
if (keyboard_nkro && keyboard_protocol) {
if (keyboard_nkro) {
add_key_bit(key); add_key_bit(key);
return; return;
} }
void del_key(uint8_t key) void del_key(uint8_t key)
{ {
#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
if (keyboard_nkro && keyboard_protocol) {
if (keyboard_nkro) {
del_key_bit(key); del_key_bit(key);
return; return;
} }
uint8_t get_first_key(void) uint8_t get_first_key(void)
{ {
#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
if (keyboard_nkro && keyboard_protocol) {
if (keyboard_nkro) {
uint8_t i = 0; uint8_t i = 0;
for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++) for (; i < REPORT_BITS && !keyboard_report->nkro.bits[i]; i++)
; ;

+ 4
- 1
protocol/lufa/lufa.c Visa fil

Endpoint_ClearStatusStage(); Endpoint_ClearStatusStage();


keyboard_protocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00); keyboard_protocol = ((USB_ControlRequest.wValue & 0xFF) != 0x00);
#ifdef NKRO_ENABLE
keyboard_nkro = !!keyboard_protocol;
#endif
clear_keyboard(); clear_keyboard();
} }
} }


/* Select the Keyboard Report Endpoint */ /* Select the Keyboard Report Endpoint */
#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
if (keyboard_nkro && keyboard_protocol) {
if (keyboard_nkro) {
/* Report protocol - NKRO */ /* Report protocol - NKRO */
Endpoint_SelectEndpoint(NKRO_IN_EPNUM); Endpoint_SelectEndpoint(NKRO_IN_EPNUM);



+ 3
- 0
protocol/pjrc/usb.c Visa fil

} }
if (bRequest == HID_SET_PROTOCOL) { if (bRequest == HID_SET_PROTOCOL) {
keyboard_protocol = wValue; keyboard_protocol = wValue;
#ifdef NKRO_ENABLE
keyboard_nkro = !!keyboard_protocol;
#endif
clear_keyboard(); clear_keyboard();
//usb_wait_in_ready(); //usb_wait_in_ready();
usb_send_in(); usb_send_in();

+ 1
- 1
protocol/pjrc/usb_keyboard.c Visa fil

int8_t result = 0; int8_t result = 0;


#ifdef NKRO_ENABLE #ifdef NKRO_ENABLE
if (keyboard_nkro && keyboard_protocol)
if (keyboard_nkro)
result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE); result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE);
else else
#endif #endif

Laddar…
Avbryt
Spara