diff options
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 d5eeffcbe4..ec95167cf6 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -732,7 +732,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(); @@ -744,15 +744,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 |