From 07edd8fff4bb7dfca1195ab9cf9f21cd4370907b Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Wed, 12 Jun 2024 22:40:20 -0700 Subject: [PATCH] LUFA: make send_report a boolean --- tmk_core/protocol/lufa/lufa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 2142b04460..26c0892773 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -87,10 +87,10 @@ static void send_mouse(report_mouse_t *report); static void send_extra(report_extra_t *report); host_driver_t lufa_driver = {keyboard_leds, send_keyboard, send_nkro, send_mouse, send_extra}; -void send_report(uint8_t endpoint, void *report, size_t size) { +bool send_report(uint8_t endpoint, void *report, size_t size) { uint8_t timeout = 255; - if (USB_DeviceState != DEVICE_STATE_Configured) return; + if (USB_DeviceState != DEVICE_STATE_Configured) return false; Endpoint_SelectEndpoint(endpoint); @@ -98,10 +98,11 @@ void send_report(uint8_t endpoint, void *report, size_t size) { while (timeout-- && !Endpoint_IsReadWriteAllowed()) { _delay_us(40); } - if (!Endpoint_IsReadWriteAllowed()) return; + if (!Endpoint_IsReadWriteAllowed()) return false; Endpoint_Write_Stream_LE(report, size, NULL); Endpoint_ClearIN(); + return true; } #ifdef VIRTSER_ENABLE