X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=protocol%2Fpjrc%2Fusb_keyboard.c;h=758a4edc6c01404b2baa82ef89d10ca00d8a6402;hb=30864ea5e48c15796cc2e3e2ba4a9b50322d82a4;hp=49b85c179fb968f50f9a068e9b1c7ffcbe472c6b;hpb=ce2e06c39465b76a1780e5d594eaea7697afafd6;p=max%2Ftmk_keyboard.git diff --git a/protocol/pjrc/usb_keyboard.c b/protocol/pjrc/usb_keyboard.c index 49b85c17..758a4edc 100644 --- a/protocol/pjrc/usb_keyboard.c +++ b/protocol/pjrc/usb_keyboard.c @@ -34,12 +34,12 @@ // protocol setting from the host. We use exactly the same report // either way, so this variable only stores the setting since we // are required to be able to report which setting is in use. -uint8_t usb_keyboard_protocol=1; +uint8_t keyboard_protocol=1; // the idle configuration, how often we send the report to the // host (ms * 4) even when it hasn't changed // Windows and Linux set 0 while OS X sets 6(24ms) by SET_IDLE request. -uint8_t usb_keyboard_idle_config=125; +uint8_t keyboard_idle=125; // count until idle timeout uint8_t usb_keyboard_idle_count=0; @@ -57,14 +57,11 @@ int8_t usb_keyboard_send_report(report_keyboard_t *report) #ifdef NKRO_ENABLE if (keyboard_nkro) - result = send_report(report, KBD2_ENDPOINT, 0, KBD2_REPORT_KEYS); + result = send_report(report, KBD2_ENDPOINT, 0, KBD2_SIZE); else #endif { - if (usb_keyboard_protocol) - result = send_report(report, KBD_ENDPOINT, 0, KBD_REPORT_KEYS); - else - result = send_report(report, KBD_ENDPOINT, 0, 6); + result = send_report(report, KBD_ENDPOINT, 0, KBD_SIZE); } if (result) return result; @@ -104,15 +101,8 @@ static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, ui cli(); UENUM = endpoint; } - UEDATX = report->mods; -#ifdef NKRO_ENABLE - if (!keyboard_nkro) - UEDATX = 0; -#else - UEDATX = 0; -#endif for (uint8_t i = keys_start; i < keys_end; i++) { - UEDATX = report->keys[i]; + UEDATX = report->raw[i]; } UEINTX = 0x3A; SREG = intr_state;