diff --git a/quantum/raw_hid.h b/quantum/raw_hid.h index 16830833cc..3a51bedeb2 100644 --- a/quantum/raw_hid.h +++ b/quantum/raw_hid.h @@ -26,6 +26,6 @@ void raw_hid_receive(uint8_t *data, uint8_t length); * \param data A pointer to the data to send. Must always be 32 bytes in length. * \param length The length of the buffer. Must always be 32. */ -void raw_hid_send(uint8_t *data, uint8_t length); +bool raw_hid_send(uint8_t *data, uint8_t length); /** \} */ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index bf190b1f18..2cc7e27c27 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -715,11 +715,13 @@ static void udi_hid_raw_report_sent(udd_ep_status_t status, iram_size_t nb_sent, static void udi_hid_raw_setreport_valid(void) {} -void raw_hid_send(uint8_t *data, uint8_t length) { +bool raw_hid_send(uint8_t *data, uint8_t length) { if (main_b_raw_enable && !udi_hid_raw_b_report_trans_ongoing && length == UDI_HID_RAW_REPORT_SIZE) { memcpy(udi_hid_raw_report, data, UDI_HID_RAW_REPORT_SIZE); udi_hid_raw_send_report(); + return true; } + return false; } bool udi_hid_raw_receive_report(void) { diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 2024a3bc7f..365f5a3923 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -529,11 +529,11 @@ void console_task(void) { #endif /* CONSOLE_ENABLE */ #ifdef RAW_ENABLE -void raw_hid_send(uint8_t *data, uint8_t length) { +bool raw_hid_send(uint8_t *data, uint8_t length) { if (length != RAW_EPSIZE) { - return; + return false; } - send_report(USB_ENDPOINT_IN_RAW, data, length); + return send_report(USB_ENDPOINT_IN_RAW, data, length); } __attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) { diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 26c0892773..86b1bc47d4 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -138,9 +138,9 @@ USB_ClassInfo_CDC_Device_t cdc_device = { * * FIXME: Needs doc */ -void raw_hid_send(uint8_t *data, uint8_t length) { - if (length != RAW_EPSIZE) return; - send_report(RAW_IN_EPNUM, data, RAW_EPSIZE); +bool raw_hid_send(uint8_t *data, uint8_t length) { + if (length != RAW_EPSIZE) return false; + return send_report(RAW_IN_EPNUM, data, RAW_EPSIZE); } /** \brief Raw HID Receive diff --git a/tmk_core/protocol/vusb/vusb.c b/tmk_core/protocol/vusb/vusb.c index c8ab494253..c7e45016da 100644 --- a/tmk_core/protocol/vusb/vusb.c +++ b/tmk_core/protocol/vusb/vusb.c @@ -147,12 +147,13 @@ static void send_report(uint8_t endpoint, void *report, size_t size) { static uint8_t raw_output_buffer[RAW_BUFFER_SIZE]; static uint8_t raw_output_received_bytes = 0; -void raw_hid_send(uint8_t *data, uint8_t length) { +bool raw_hid_send(uint8_t *data, uint8_t length) { if (length != RAW_BUFFER_SIZE) { - return; + return false; } send_report(4, data, 32); + return true; } __attribute__((weak)) void raw_hid_receive(uint8_t *data, uint8_t length) {