Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust EXTRAKEY_ENABLE ifdefs for send_extra() #18249

Merged
merged 1 commit into from
Sep 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tmk_core/protocol/arm_atsam/main_arm_atsam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tmk_core/protocol/chibios/usb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tmk_core/protocol/lufa/lufa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tmk_core/protocol/vusb/vusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand Down