Skip to content

Commit 08b6748

Browse files
Update to PICO-SDK version 1.2.0 (#207)
Minor rev to the tinyUSB version used, new ID function.
1 parent bedfbda commit 08b6748

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

cores/rp2040/RP2040USB.cpp

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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-

cores/rp2040/SerialUSB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ int SerialUSB::peek() {
7070
}
7171

7272
uint8_t c;
73-
return tud_cdc_peek(0, &c) ? (int) c : -1;
73+
return tud_cdc_peek(&c) ? (int) c : -1;
7474
}
7575

7676
int SerialUSB::read() {

lib/libpico.a

69.8 KB
Binary file not shown.

lib/pico_base/pico/version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
#define _PICO_VERSION_H
1313

1414
#define PICO_SDK_VERSION_MAJOR 1
15-
#define PICO_SDK_VERSION_MINOR 1
16-
#define PICO_SDK_VERSION_REVISION 2
17-
#define PICO_SDK_VERSION_STRING "1.1.2"
15+
#define PICO_SDK_VERSION_MINOR 2
16+
#define PICO_SDK_VERSION_REVISION 0
17+
#define PICO_SDK_VERSION_STRING "1.2.0"
1818

1919
#endif

pico-sdk

Submodule pico-sdk updated 184 files

0 commit comments

Comments
 (0)