diff options
author | Ryan <[email protected]> | 2023-10-23 14:43:46 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-10-23 15:43:46 +1100 |
commit | 0c160e1fbafbf477c74e64fd8ab9a9121eb0f42a (patch) | |
tree | 7a6e361a5fe396b72029ab03d7e00abe1f19a105 /tmk_core/protocol/arm_atsam | |
parent | bf6f13a2b0a185e935b8554e41317ab471a4c0ec (diff) | |
download | qmk_firmware-0c160e1fbafbf477c74e64fd8ab9a9121eb0f42a.tar.gz qmk_firmware-0c160e1fbafbf477c74e64fd8ab9a9121eb0f42a.zip |
Separate 6KRO and NKRO report structs (#22267)
Diffstat (limited to 'tmk_core/protocol/arm_atsam')
-rw-r--r-- | tmk_core/protocol/arm_atsam/main_arm_atsam.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 30817c17b6..8abcfd6090 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -36,6 +36,7 @@ uint8_t g_usb_state = USB_FSMSTATUS_FSMSTATE_OFF_Val; // Saved USB state from ha void main_subtasks(void); uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); +void send_nkro(report_nkro_t *report); void send_mouse(report_mouse_t *report); void send_extra(report_extra_t *report); @@ -43,7 +44,7 @@ void send_extra(report_extra_t *report); void deferred_exec_task(void); #endif // DEFERRED_EXEC_ENABLE -host_driver_t arm_atsam_driver = {keyboard_leds, send_keyboard, send_mouse, send_extra}; +host_driver_t arm_atsam_driver = {keyboard_leds, send_keyboard, send_nkro, send_mouse, send_extra}; uint8_t led_states; @@ -59,41 +60,41 @@ uint8_t keyboard_leds(void) { void send_keyboard(report_keyboard_t *report) { uint32_t irqflags; -#ifdef NKRO_ENABLE - if (!keymap_config.nkro) { -#endif // NKRO_ENABLE - while (udi_hid_kbd_b_report_trans_ongoing) { - main_subtasks(); - } // Run other tasks while waiting for USB to be free + while (udi_hid_kbd_b_report_trans_ongoing) { + main_subtasks(); + } // Run other tasks while waiting for USB to be free - irqflags = __get_PRIMASK(); - __disable_irq(); - __DMB(); + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); - memcpy(udi_hid_kbd_report, report->raw, UDI_HID_KBD_REPORT_SIZE); - udi_hid_kbd_b_report_valid = 1; - udi_hid_kbd_send_report(); + memcpy(udi_hid_kbd_report, report, UDI_HID_KBD_REPORT_SIZE); + udi_hid_kbd_b_report_valid = 1; + udi_hid_kbd_send_report(); - __DMB(); - __set_PRIMASK(irqflags); + __DMB(); + __set_PRIMASK(irqflags); +} + +void send_nkro(report_nkro_t *report) { #ifdef NKRO_ENABLE - } else { - while (udi_hid_nkro_b_report_trans_ongoing) { - main_subtasks(); - } // Run other tasks while waiting for USB to be free + uint32_t irqflags; - irqflags = __get_PRIMASK(); - __disable_irq(); - __DMB(); + while (udi_hid_nkro_b_report_trans_ongoing) { + main_subtasks(); + } // Run other tasks while waiting for USB to be free - memcpy(udi_hid_nkro_report, report->raw, UDI_HID_NKRO_REPORT_SIZE); - udi_hid_nkro_b_report_valid = 1; - udi_hid_nkro_send_report(); + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); - __DMB(); - __set_PRIMASK(irqflags); - } -#endif // NKRO_ENABLE + memcpy(udi_hid_nkro_report, report, UDI_HID_NKRO_REPORT_SIZE); + udi_hid_nkro_b_report_valid = 1; + udi_hid_nkro_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); +#endif } void send_mouse(report_mouse_t *report) { |