summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/host.c
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2023-10-23 14:43:46 +1000
committerGitHub <noreply@github.com>2023-10-23 15:43:46 +1100
commit0c160e1fbafbf477c74e64fd8ab9a9121eb0f42a (patch)
tree7a6e361a5fe396b72029ab03d7e00abe1f19a105 /tmk_core/protocol/host.c
parentbf6f13a2b0a185e935b8554e41317ab471a4c0ec (diff)
Separate 6KRO and NKRO report structs (#22267)
Diffstat (limited to 'tmk_core/protocol/host.c')
-rw-r--r--tmk_core/protocol/host.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/tmk_core/protocol/host.c b/tmk_core/protocol/host.c
index 2c6654e9a6..732fbdc37d 100644
--- a/tmk_core/protocol/host.c
+++ b/tmk_core/protocol/host.c
@@ -81,26 +81,29 @@ void host_keyboard_send(report_keyboard_t *report) {
#endif
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;
+ report->report_id = REPORT_ID_KEYBOARD;
#endif
- }
(*driver->send_keyboard)(report);
if (debug_keyboard) {
- dprint("keyboard_report: ");
- for (uint8_t i = 0; i < KEYBOARD_REPORT_SIZE; i++) {
- dprintf("%02X ", report->raw[i]);
+ dprintf("keyboard_report: %02X | ", report->mods);
+ for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
+ dprintf("%02X ", report->keys[i]);
+ }
+ dprint("\n");
+ }
+}
+
+void host_nkro_send(report_nkro_t *report) {
+ if (!driver) return;
+ report->report_id = REPORT_ID_NKRO;
+ (*driver->send_nkro)(report);
+
+ if (debug_keyboard) {
+ dprintf("nkro_report: %02X | ", report->mods);
+ for (uint8_t i = 0; i < NKRO_REPORT_BITS; i++) {
+ dprintf("%02X ", report->bits[i]);
}
dprint("\n");
}