diff options
author | Ryan <fauxpark@gmail.com> | 2020-02-25 12:18:11 +1100 |
---|---|---|
committer | Drashna Jael're <drashna@live.com> | 2020-03-26 00:42:13 -0700 |
commit | ebb243aacee704cf5bbb63b65439c06703ba5bc1 (patch) | |
tree | 4a3df9e767d1497e07baa99147fbc8af30b05208 /tmk_core/protocol/chibios | |
parent | f4b460c20042b1d04abab1931f81513ac0031c37 (diff) |
Improvements to extrakey HID descriptors (#8156)
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r-- | tmk_core/protocol/chibios/usb_main.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index e05c4c5055..6192baa4d2 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -783,7 +783,7 @@ void shared_in_cb(USBDriver *usbp, usbep_t ep) { */ #ifdef EXTRAKEY_ENABLE -static void send_extra_report(uint8_t report_id, uint16_t data) { +static void send_extra(uint8_t report_id, uint16_t data) { osalSysLock(); if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { osalSysUnlock(); @@ -795,15 +795,19 @@ static void send_extra_report(uint8_t report_id, uint16_t data) { usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); osalSysUnlock(); } +#endif -void send_system(uint16_t data) { send_extra_report(REPORT_ID_SYSTEM, data); } - -void send_consumer(uint16_t data) { send_extra_report(REPORT_ID_CONSUMER, data); } +void send_system(uint16_t data) { +#ifdef EXTRAKEY_ENABLE + send_extra(REPORT_ID_SYSTEM, data); +#endif +} -#else /* EXTRAKEY_ENABLE */ -void send_system(uint16_t data) { (void)data; } -void send_consumer(uint16_t data) { (void)data; } -#endif /* EXTRAKEY_ENABLE */ +void send_consumer(uint16_t data) { +#ifdef EXTRAKEY_ENABLE + send_extra(REPORT_ID_CONSUMER, data); +#endif +} /* --------------------------------------------------------- * Console functions |