Skip to content

Commit d8e9044

Browse files
committed
increase TINYUSB_API_VERSION to 20400 for new _strid and new configuration builder
add backward compatible with core including pre-2.4.0 version
1 parent b5fb020 commit d8e9044

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/arduino/Adafruit_TinyUSB_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
// API Version, need to be updated when there is changes for
3232
// TinyUSB_API, USBD_CDC, USBD_Device, USBD_Interface,
33-
#define TINYUSB_API_VERSION 20000
33+
#define TINYUSB_API_VERSION 20400
3434

3535
//--------------------------------------------------------------------+
3636
// Core API

src/arduino/Adafruit_USBD_CDC.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,14 @@ uint16_t Adafruit_USBD_CDC::getInterfaceDescriptor(uint8_t itfnum_deprecated,
6464
ep_out = TinyUSBDevice.allocEndpoint(TUSB_DIR_OUT);
6565
}
6666

67+
#if TINYUSB_API_VERSION < 20400
68+
// backward compatible for core that include pre-2.4.0 TinyUSB
69+
uint8_t _strid = 0;
70+
#endif
71+
6772
uint8_t const desc[] = {
6873
TUD_CDC_DESCRIPTOR(itfnum, _strid, ep_notif, 8, ep_out, ep_in, 64)};
74+
6975
uint16_t const len = sizeof(desc);
7076

7177
// null buffer is used to get the length of descriptor only

0 commit comments

Comments
 (0)