diff --git a/libraries/USB/src/USBHID.cpp b/libraries/USB/src/USBHID.cpp index a5bdb2d6739..ae0103d4a7f 100644 --- a/libraries/USB/src/USBHID.cpp +++ b/libraries/USB/src/USBHID.cpp @@ -310,7 +310,21 @@ bool USBHID::ready(void){ return tud_hid_n_ready(0); } -void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint8_t len){ +// TinyUSB is in the process of changing the type of the last argument to +// tud_hid_report_complete_cb(), so extract the type from the version of TinyUSB that we're +// compiled with. +template struct ArgType; + +template +struct ArgType { + typedef T1 type1; + typedef T2 type2; + typedef T3 type3; +}; + +typedef ArgType::type3 tud_hid_report_complete_cb_len_t; + +void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, tud_hid_report_complete_cb_len_t len){ if (tinyusb_hid_device_input_sem) { xSemaphoreGive(tinyusb_hid_device_input_sem); }