increase TINYUSB_API_VERSION to 20400 for new _strid and new configuration builder

add backward compatible with core including pre-2.4.0 version
This commit is contained in:
hathach 2024-01-30 23:19:36 +07:00
parent b5fb020216
commit d8e9044069
2 changed files with 7 additions and 1 deletions

View file

@ -30,7 +30,7 @@
// API Version, need to be updated when there is changes for
// TinyUSB_API, USBD_CDC, USBD_Device, USBD_Interface,
#define TINYUSB_API_VERSION 20000
#define TINYUSB_API_VERSION 20400
//--------------------------------------------------------------------+
// Core API

View file

@ -64,8 +64,14 @@ uint16_t Adafruit_USBD_CDC::getInterfaceDescriptor(uint8_t itfnum_deprecated,
ep_out = TinyUSBDevice.allocEndpoint(TUSB_DIR_OUT);
}
#if TINYUSB_API_VERSION < 20400
// backward compatible for core that include pre-2.4.0 TinyUSB
uint8_t _strid = 0;
#endif
uint8_t const desc[] = {
TUD_CDC_DESCRIPTOR(itfnum, _strid, ep_notif, 8, ep_out, ep_in, 64)};
uint16_t const len = sizeof(desc);
// null buffer is used to get the length of descriptor only