summaryrefslogtreecommitdiff
path: root/tmk_core/protocol/chibios
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-02-25 12:18:11 +1100
committerGitHub <noreply@github.com>2020-02-25 12:18:11 +1100
commit088b64ab3d598574244db5ac67fec889bdc58119 (patch)
tree130709c89d516c3c91177ae0b310017c32b51ffb /tmk_core/protocol/chibios
parentef8878fba5d3786e3f9c66436da63a560cd36ac9 (diff)
downloadqmk_firmware-088b64ab3d598574244db5ac67fec889bdc58119.tar.gz
qmk_firmware-088b64ab3d598574244db5ac67fec889bdc58119.zip
Improvements to extrakey HID descriptors (#8156)
Diffstat (limited to 'tmk_core/protocol/chibios')
-rw-r--r--tmk_core/protocol/chibios/usb_main.c20
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