X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=tmk_core%2Fcommon%2Fhost.c;h=f5d0416996b10b23959f8dcc862011a95d6ec31c;hb=6e984a8b5e34ba181b0893a929af569a1faef2b6;hp=e9b791670670eed07b9956495c1fc38dde989bab;hpb=79cfa894afbc0a94ac642f57de905d9afc068ce7;p=qmk_firmware.git diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c index e9b791670..f5d041699 100644 --- a/tmk_core/common/host.c +++ b/tmk_core/common/host.c @@ -22,9 +22,9 @@ along with this program. If not, see . #include "util.h" #include "debug.h" - #ifdef NKRO_ENABLE -bool keyboard_nkro = true; + #include "keycode_config.h" + extern keymap_config_t keymap_config; #endif static host_driver_t *driver; @@ -51,6 +51,20 @@ uint8_t host_keyboard_leds(void) void host_keyboard_send(report_keyboard_t *report) { if (!driver) return; +#if defined(NKRO_ENABLE) && defined(NKRO_SHARED_EP) + if (keyboard_protocol && keymap_config.nkro) { + /* The callers of this function assume that report->mods is where mods go in. + * But report->nkro.mods can be at a different offset if core keyboard does not have a report ID. + */ + report->nkro.mods = report->mods; + report->nkro.report_id = REPORT_ID_NKRO; + } else +#endif + { +#ifdef KEYBOARD_SHARED_EP + report->report_id = REPORT_ID_KEYBOARD; +#endif + } (*driver->send_keyboard)(report); if (debug_keyboard) { @@ -65,6 +79,9 @@ void host_keyboard_send(report_keyboard_t *report) void host_mouse_send(report_mouse_t *report) { if (!driver) return; +#ifdef MOUSE_SHARED_EP + report->report_id = REPORT_ID_MOUSE; +#endif (*driver->send_mouse)(report); } @@ -86,7 +103,7 @@ void host_consumer_send(uint16_t report) (*driver->send_consumer)(report); } -uint16_t host_last_sysytem_report(void) +uint16_t host_last_system_report(void) { return last_system_report; }