Adjust `EXTRAKEY_ENABLE` ifdefs for `send_extra()` (#18249)

This commit is contained in:
Ryan 2022-09-03 06:50:36 +10:00 committed by GitHub
parent 09d668eb0e
commit f76b55d5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -113,8 +113,8 @@ void send_mouse(report_mouse_t *report) {
#endif // MOUSEKEY_ENABLE #endif // MOUSEKEY_ENABLE
} }
#ifdef EXTRAKEY_ENABLE
void send_extra(uint8_t report_id, uint16_t data) { void send_extra(uint8_t report_id, uint16_t data) {
#ifdef EXTRAKEY_ENABLE
uint32_t irqflags; uint32_t irqflags;
irqflags = __get_PRIMASK(); irqflags = __get_PRIMASK();
@ -128,8 +128,8 @@ void send_extra(uint8_t report_id, uint16_t data) {
__DMB(); __DMB();
__set_PRIMASK(irqflags); __set_PRIMASK(irqflags);
}
#endif // EXTRAKEY_ENABLE #endif // EXTRAKEY_ENABLE
}
#ifdef CONSOLE_ENABLE #ifdef CONSOLE_ENABLE
# define CONSOLE_PRINTBUF_SIZE 512 # define CONSOLE_PRINTBUF_SIZE 512

View File

@ -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) { void send_extra(uint8_t report_id, uint16_t data) {
#ifdef EXTRAKEY_ENABLE
osalSysLock(); osalSysLock();
if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { if (usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) {
osalSysUnlock(); 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)); usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t));
osalSysUnlock(); osalSysUnlock();
}
#endif #endif
}
void send_programmable_button(uint32_t data) { void send_programmable_button(uint32_t data) {
#ifdef PROGRAMMABLE_BUTTON_ENABLE #ifdef PROGRAMMABLE_BUTTON_ENABLE

View File

@ -745,8 +745,8 @@ static void send_report(void *report, size_t size) {
* *
* FIXME: Needs doc * FIXME: Needs doc
*/ */
#ifdef EXTRAKEY_ENABLE
static void send_extra(uint8_t report_id, uint16_t data) { static void send_extra(uint8_t report_id, uint16_t data) {
#ifdef EXTRAKEY_ENABLE
# ifdef BLUETOOTH_ENABLE # ifdef BLUETOOTH_ENABLE
if (report_id == REPORT_ID_CONSUMER && where_to_send() == OUTPUT_BLUETOOTH) { if (report_id == REPORT_ID_CONSUMER && where_to_send() == OUTPUT_BLUETOOTH) {
# ifdef BLUETOOTH_BLUEFRUIT_LE # ifdef BLUETOOTH_BLUEFRUIT_LE
@ -761,8 +761,8 @@ static void send_extra(uint8_t report_id, uint16_t data) {
static report_extra_t r; static report_extra_t r;
r = (report_extra_t){.report_id = report_id, .usage = data}; r = (report_extra_t){.report_id = report_id, .usage = data};
send_report(&r, sizeof(r)); send_report(&r, sizeof(r));
}
#endif #endif
}
static void send_programmable_button(uint32_t data) { static void send_programmable_button(uint32_t data) {
#ifdef PROGRAMMABLE_BUTTON_ENABLE #ifdef PROGRAMMABLE_BUTTON_ENABLE

View File

@ -268,8 +268,8 @@ static void send_mouse(report_mouse_t *report) {
#endif #endif
} }
#ifdef EXTRAKEY_ENABLE
static void send_extra(uint8_t report_id, uint16_t data) { static void send_extra(uint8_t report_id, uint16_t data) {
#ifdef EXTRAKEY_ENABLE
static uint8_t last_id = 0; static uint8_t last_id = 0;
static uint16_t last_data = 0; static uint16_t last_data = 0;
if ((report_id == last_id) && (data == last_data)) return; 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()) { if (usbInterruptIsReadyShared()) {
usbSetInterruptShared((void *)&report, sizeof(report_extra_t)); usbSetInterruptShared((void *)&report, sizeof(report_extra_t));
} }
}
#endif #endif
}
void send_digitizer(report_digitizer_t *report) { void send_digitizer(report_digitizer_t *report) {
#ifdef DIGITIZER_ENABLE #ifdef DIGITIZER_ENABLE