@@ -153,7 +153,8 @@ static uint8_t *GetDescHIDReport(int *len) {
153153// Invoked when received GET HID REPORT DESCRIPTOR
154154// Application return pointer to descriptor
155155// Descriptor contents must exist long enough for transfer to complete
156- uint8_t const * tud_hid_descriptor_report_cb (void ) {
156+ uint8_t const * tud_hid_descriptor_report_cb (uint8_t instance) {
157+ (void ) instance;
157158 return GetDescHIDReport (nullptr );
158159}
159160
@@ -177,7 +178,7 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
177178 uint8_t hid_itf = __USBInstallSerial ? 2 : 0 ;
178179 static uint8_t hid_desc[TUD_HID_DESC_LEN] = {
179180 // Interface number, string index, protocol, report descriptor len, EP In & Out address, size & polling interval
180- TUD_HID_DESCRIPTOR (hid_itf, 0 , HID_PROTOCOL_NONE , hid_report_len, EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 10 )
181+ TUD_HID_DESCRIPTOR (hid_itf, 0 , HID_ITF_PROTOCOL_NONE , hid_report_len, EPNUM_HID, CFG_TUD_HID_EP_BUFSIZE, 10 )
181182 };
182183
183184 uint8_t midi_itf = hid_itf + (hasHID ? 1 : 0 );
@@ -230,15 +231,7 @@ const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
230231 };
231232
232233 if (!idString[0 ]) {
233- // Get ID string into human readable serial number on the first pass
234- pico_unique_board_id_t id;
235- pico_get_unique_board_id (&id);
236- idString[0 ] = 0 ;
237- for (auto i = 0 ; i < PICO_UNIQUE_BOARD_ID_SIZE_BYTES; i++) {
238- char hx[3 ];
239- sprintf (hx, " %02X" , id.id [i]);
240- strcat (idString, hx);
241- }
234+ pico_get_unique_board_id_string (idString, sizeof (idString));
242235 }
243236
244237 uint8_t len;
@@ -296,8 +289,9 @@ void __USBStart() {
296289// Invoked when received GET_REPORT control request
297290// Application must fill buffer report's content and return its length.
298291// Return zero will cause the stack to STALL request
299- uint16_t tud_hid_get_report_cb (uint8_t report_id, hid_report_type_t report_type, uint8_t * buffer, uint16_t reqlen) {
300- // TODO not Implemented
292+ extern " C" uint16_t tud_hid_get_report_cb (uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t * buffer, uint16_t reqlen) {
293+ // TODO not implemented
294+ (void ) instance;
301295 (void ) report_id;
302296 (void ) report_type;
303297 (void ) buffer;
@@ -308,13 +302,13 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type,
308302
309303// Invoked when received SET_REPORT control request or
310304// received data on OUT endpoint ( Report ID = 0, Type = 0 )
311- void tud_hid_set_report_cb (uint8_t report_id, hid_report_type_t report_type, uint8_t const * buffer, uint16_t bufsize) {
305+ extern " C " void tud_hid_set_report_cb (uint8_t instance, uint8_t report_id, hid_report_type_t report_type, uint8_t const * buffer, uint16_t bufsize) {
312306 // TODO set LED based on CAPLOCK, NUMLOCK etc...
307+ (void ) instance;
313308 (void ) report_id;
314309 (void ) report_type;
315310 (void ) buffer;
316311 (void ) bufsize;
317312}
318313
319314#endif
320-
0 commit comments