diff options
author | Ryan <fauxpark@gmail.com> | 2022-10-05 09:19:12 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-05 09:19:12 +1100 |
commit | 09d3e2771099ff1ca7e7bd8882644eb2b2807763 (patch) | |
tree | dcbd230a0b83d19f2561eaa606dcd4ae3b97a109 /tmk_core/protocol/chibios | |
parent | 3168a3c88388d75dc9f4e221c429163c3ecbda4f (diff) |
Refactor more host code (programmable button & digitizer) (#18565)
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r-- | tmk_core/protocol/chibios/chibios.c | 4 | ||||
-rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 9 |
2 files changed, 3 insertions, 10 deletions
diff --git a/tmk_core/protocol/chibios/chibios.c b/tmk_core/protocol/chibios/chibios.c index 024160a925..82ade4259b 100644 --- a/tmk_core/protocol/chibios/chibios.c +++ b/tmk_core/protocol/chibios/chibios.c @@ -59,11 +59,9 @@ uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); void send_mouse(report_mouse_t *report); void send_extra(uint8_t report_id, uint16_t data); -void send_programmable_button(uint32_t data); -void send_digitizer(report_digitizer_t *report); /* host struct */ -host_driver_t chibios_driver = {keyboard_leds, send_keyboard, send_mouse, send_extra, send_programmable_button}; +host_driver_t chibios_driver = {keyboard_leds, send_keyboard, send_mouse, send_extra}; #ifdef VIRTSER_ENABLE void virtser_task(void); diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 3e64ceab19..3fd34a604e 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -970,7 +970,7 @@ void send_extra(uint8_t report_id, uint16_t data) { #endif } -void send_programmable_button(uint32_t data) { +void send_programmable_button(report_programmable_button_t *report) { #ifdef PROGRAMMABLE_BUTTON_ENABLE osalSysLock(); if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { @@ -988,13 +988,8 @@ void send_programmable_button(uint32_t data) { return; } } - static report_programmable_button_t report = { - .report_id = REPORT_ID_PROGRAMMABLE_BUTTON, - }; - - report.usage = data; - usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report)); + usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)report, sizeof(report_programmable_button_t)); osalSysUnlock(); #endif } |