diff options
author | Ryan <fauxpark@gmail.com> | 2022-10-07 13:35:01 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 19:35:01 -0700 |
commit | 6dbbeea46a0ac7527235982cb6406802df846805 (patch) | |
tree | 55b2a71430ad3726ab098a53b581a69efdd1602d /tmk_core/protocol/vusb | |
parent | cbe1c22d468d64d7a3274061ce9c2073ecb208a4 (diff) |
Refactor `send_extra` (#18615)
Diffstat (limited to 'tmk_core/protocol/vusb')
-rw-r--r-- | tmk_core/protocol/vusb/vusb.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index 8456d2c5ab..84b01b203e 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -224,7 +224,7 @@ void console_task(void) { static uint8_t keyboard_leds(void); static void send_keyboard(report_keyboard_t *report); static void send_mouse(report_mouse_t *report); -static void send_extra(uint8_t report_id, uint16_t data); +static void send_extra(report_extra_t *report); static host_driver_t driver = {keyboard_leds, send_keyboard, send_mouse, send_extra}; @@ -267,18 +267,10 @@ static void send_mouse(report_mouse_t *report) { #endif } -static void send_extra(uint8_t report_id, uint16_t data) { +static void send_extra(report_extra_t *report) { #ifdef EXTRAKEY_ENABLE - static uint8_t last_id = 0; - static uint16_t last_data = 0; - if ((report_id == last_id) && (data == last_data)) return; - last_id = report_id; - last_data = data; - - static report_extra_t report; - report = (report_extra_t){.report_id = report_id, .usage = data}; if (usbInterruptIsReadyShared()) { - usbSetInterruptShared((void *)&report, sizeof(report_extra_t)); + usbSetInterruptShared((void *)report, sizeof(report_extra_t)); } #endif } |