summaryrefslogtreecommitdiff
path: root/tmk_core/protocol
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-09-03 06:50:36 +1000
committerGitHub <noreply@github.com>2022-09-02 21:50:36 +0100
commitf76b55d5add98a70331338d4bee11ffd963a886a (patch)
tree2787993bb42b22dd284e5aa48fc7526fbfd8a050 /tmk_core/protocol
parent09d668eb0ed3ff6fa48ce1db98910b022bca2d90 (diff)
Adjust `EXTRAKEY_ENABLE` ifdefs for `send_extra()` (#18249)
Diffstat (limited to 'tmk_core/protocol')
-rw-r--r--tmk_core/protocol/arm_atsam/main_arm_atsam.c4
-rw-r--r--tmk_core/protocol/chibios/usb_main.c4
-rw-r--r--tmk_core/protocol/lufa/lufa.c4
-rw-r--r--tmk_core/protocol/vusb/vusb.c4
4 files changed, 8 insertions, 8 deletions
diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c
index a2f20db66e..0537e3937d 100644
--- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c
+++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c
@@ -113,8 +113,8 @@ void send_mouse(report_mouse_t *report) {
#endif // MOUSEKEY_ENABLE
}
-#ifdef EXTRAKEY_ENABLE
void send_extra(uint8_t report_id, uint16_t data) {
+#ifdef EXTRAKEY_ENABLE
uint32_t irqflags;
irqflags = __get_PRIMASK();
@@ -128,8 +128,8 @@ void send_extra(uint8_t report_id, uint16_t data) {
__DMB();
__set_PRIMASK(irqflags);
-}
#endif // EXTRAKEY_ENABLE
+}
#ifdef CONSOLE_ENABLE
# define CONSOLE_PRINTBUF_SIZE 512
diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c
index d218deb6f9..222a867e3c 100644
--- a/tmk_core/protocol/chibios/usb_main.c
+++ b/tmk_core/protocol/chibios/usb_main.c
@@ -946,8 +946,8 @@ void shared_in_cb(USBDriver *usbp, usbep_t ep) {
* ---------------------------------------------------------
*/
-#ifdef EXTRAKEY_ENABLE
void send_extra(uint8_t report_id, uint16_t data) {
+#ifdef EXTRAKEY_ENABLE
osalSysLock();
if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) {
osalSysUnlock();
@@ -970,8 +970,8 @@ void send_extra(uint8_t report_id, uint16_t data) {
usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t));
osalSysUnlock();
-}
#endif
+}
void send_programmable_button(uint32_t data) {
#ifdef PROGRAMMABLE_BUTTON_ENABLE
diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c
index 5c1a9b600e..03e19745f8 100644
--- a/tmk_core/protocol/lufa/lufa.c
+++ b/tmk_core/protocol/lufa/lufa.c
@@ -745,8 +745,8 @@ static void send_report(void *report, size_t size) {
*
* FIXME: Needs doc
*/
-#ifdef EXTRAKEY_ENABLE
static void send_extra(uint8_t report_id, uint16_t data) {
+#ifdef EXTRAKEY_ENABLE
# ifdef BLUETOOTH_ENABLE
if (report_id == REPORT_ID_CONSUMER && where_to_send() == OUTPUT_BLUETOOTH) {
# ifdef BLUETOOTH_BLUEFRUIT_LE
@@ -761,8 +761,8 @@ static void send_extra(uint8_t report_id, uint16_t data) {
static report_extra_t r;
r = (report_extra_t){.report_id = report_id, .usage = data};
send_report(&r, sizeof(r));
-}
#endif
+}
static void send_programmable_button(uint32_t data) {
#ifdef PROGRAMMABLE_BUTTON_ENABLE
diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c
index ed90b1151a..013d637b6f 100644
--- a/tmk_core/protocol/vusb/vusb.c
+++ b/tmk_core/protocol/vusb/vusb.c
@@ -268,8 +268,8 @@ static void send_mouse(report_mouse_t *report) {
#endif
}
-#ifdef EXTRAKEY_ENABLE
static void send_extra(uint8_t report_id, uint16_t data) {
+#ifdef EXTRAKEY_ENABLE
static uint8_t last_id = 0;
static uint16_t last_data = 0;
if ((report_id == last_id) && (data == last_data)) return;
@@ -281,8 +281,8 @@ static void send_extra(uint8_t report_id, uint16_t data) {
if (usbInterruptIsReadyShared()) {
usbSetInterruptShared((void *)&report, sizeof(report_extra_t));
}
-}
#endif
+}
void send_digitizer(report_digitizer_t *report) {
#ifdef DIGITIZER_ENABLE