summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios/usb_main.c
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-10-07 13:35:01 +1100
committerGitHub <noreply@github.com>2022-10-06 19:35:01 -0700
commit6dbbeea46a0ac7527235982cb6406802df846805 (patch)
tree55b2a71430ad3726ab098a53b581a69efdd1602d /tmk_core/protocol/chibios/usb_main.c
parentcbe1c22d468d64d7a3274061ce9c2073ecb208a4 (diff)
Refactor `send_extra` (#18615)
Diffstat (limited to 'tmk_core/protocol/chibios/usb_main.c')
-rw-r--r--tmk_core/protocol/chibios/usb_main.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index 3fd34a604e..5eda5dd09f 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -943,7 +943,7 @@ void shared_in_cb(USBDriver *usbp, usbep_t ep) {
* ---------------------------------------------------------
*/
-void send_extra(uint8_t report_id, uint16_t data) {
+void send_extra(report_extra_t *report) {
#ifdef EXTRAKEY_ENABLE
osalSysLock();
if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) {
@@ -962,10 +962,7 @@ void send_extra(uint8_t report_id, uint16_t data) {
}
}
- static report_extra_t report;
- report = (report_extra_t){.report_id = report_id, .usage = data};
-
- usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t));
+ usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)report, sizeof(report_extra_t));
osalSysUnlock();
#endif
}