@@ -153,7 +153,8 @@ static uint8_t *GetDescHIDReport(int *len) {
153
153
// Invoked when received GET HID REPORT DESCRIPTOR
154
154
// Application return pointer to descriptor
155
155
// 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;
157
158
return GetDescHIDReport (nullptr );
158
159
}
159
160
@@ -177,7 +178,7 @@ const uint8_t *tud_descriptor_configuration_cb(uint8_t index) {
177
178
uint8_t hid_itf = __USBInstallSerial ? 2 : 0 ;
178
179
static uint8_t hid_desc[TUD_HID_DESC_LEN] = {
179
180
// 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 )
181
182
};
182
183
183
184
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) {
230
231
};
231
232
232
233
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));
242
235
}
243
236
244
237
uint8_t len;
@@ -296,8 +289,9 @@ void __USBStart() {
296
289
// Invoked when received GET_REPORT control request
297
290
// Application must fill buffer report's content and return its length.
298
291
// 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;
301
295
(void ) report_id;
302
296
(void ) report_type;
303
297
(void ) buffer;
@@ -308,13 +302,13 @@ uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type,
308
302
309
303
// Invoked when received SET_REPORT control request or
310
304
// 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) {
312
306
// TODO set LED based on CAPLOCK, NUMLOCK etc...
307
+ (void ) instance;
313
308
(void ) report_id;
314
309
(void ) report_type;
315
310
(void ) buffer;
316
311
(void ) bufsize;
317
312
}
318
313
319
314
#endif
320
-
0 commit comments