File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
cores/nRF5/usb/Adafruit_TinyUSB_core Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ uint16_t const * const string_desc_arr [] =
53
53
};
54
54
55
55
// tud_desc_set is required by tinyusb stack
56
- // since CFG_TUD_DESC_AUTO is enabled, we only need to set string_arr
57
56
tud_desc_set_t tud_desc_set =
58
57
{
59
58
.device = NULL , // update later
@@ -134,10 +133,11 @@ Adafruit_USBD_Device::Adafruit_USBD_Device(void)
134
133
bool Adafruit_USBD_Device::addInterface (Adafruit_USBD_Interface& itf)
135
134
{
136
135
uint8_t * desc = _desc_cfg+_desc_cfglen;
137
- uint16_t len = itf.getDescriptor (desc, sizeof (_desc_cfg)-_desc_cfglen);
138
-
136
+ uint16_t const len = itf.getDescriptor (desc, sizeof (_desc_cfg)-_desc_cfglen);
139
137
uint8_t * desc_end = desc+len;
140
138
139
+ if ( !len ) return false ;
140
+
141
141
// Handle IAD
142
142
if ( desc[1 ] == TUSB_DESC_INTERFACE_ASSOCIATION )
143
143
{
Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ class Adafruit_USBD_Device
52
52
bool addInterface (Adafruit_USBD_Interface& itf);
53
53
54
54
bool begin (uint16_t vid, uint16_t pid);
55
+
56
+ bool mounted (void ) { return tud_mounted (); }
57
+ bool suspended (void ) { return tud_suspended (); }
58
+ bool ready (void ) { return tud_ready (); }
59
+ bool remoteWakeup (void ) { return tud_remote_wakeup (); }
55
60
};
56
61
57
62
extern Adafruit_USBD_Device USBDevice;
You can’t perform that action at this time.
0 commit comments