@@ -52,7 +52,6 @@ tusb_desc_device_t const desc_device = {
5252 .bDeviceClass = TUSB_CLASS_MISC ,
5353 .bDeviceSubClass = MISC_SUBCLASS_COMMON ,
5454 .bDeviceProtocol = MISC_PROTOCOL_IAD ,
55-
5655 .bMaxPacketSize0 = CFG_TUD_ENDPOINT0_SIZE ,
5756
5857 .idVendor = USB_VID ,
@@ -131,7 +130,7 @@ uint8_t const desc_fs_configuration[] =
131130 TUD_CONFIG_DESCRIPTOR (1 , ITF_NUM_TOTAL , 0 , CONFIG_TOTAL_LEN , 0x00 , 100 ),
132131
133132 // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
134- TUD_CDC_DESCRIPTOR (ITF_NUM_CDC , 4 , EPNUM_CDC_NOTIF , 8 , EPNUM_CDC_OUT , EPNUM_CDC_IN , 64 ),
133+ TUD_CDC_DESCRIPTOR (ITF_NUM_CDC , 4 , EPNUM_CDC_NOTIF , 16 , EPNUM_CDC_OUT , EPNUM_CDC_IN , 64 ),
135134
136135 // Interface number, string index, EP Out & EP In address, EP size
137136 TUD_MSC_DESCRIPTOR (ITF_NUM_MSC , 5 , EPNUM_MSC_OUT , EPNUM_MSC_IN , 64 ),
@@ -147,7 +146,7 @@ uint8_t const desc_hs_configuration[] =
147146 TUD_CONFIG_DESCRIPTOR (1 , ITF_NUM_TOTAL , 0 , CONFIG_TOTAL_LEN , 0x00 , 100 ),
148147
149148 // Interface number, string index, EP notification address and size, EP data address (out, in) and size.
150- TUD_CDC_DESCRIPTOR (ITF_NUM_CDC , 4 , EPNUM_CDC_NOTIF , 8 , EPNUM_CDC_OUT , EPNUM_CDC_IN , 512 ),
149+ TUD_CDC_DESCRIPTOR (ITF_NUM_CDC , 4 , EPNUM_CDC_NOTIF , 16 , EPNUM_CDC_OUT , EPNUM_CDC_IN , 512 ),
151150
152151 // Interface number, string index, EP Out & EP In address, EP size
153152 TUD_MSC_DESCRIPTOR (ITF_NUM_MSC , 5 , EPNUM_MSC_OUT , EPNUM_MSC_IN , 512 ),
@@ -176,16 +175,14 @@ tusb_desc_device_qualifier_t const desc_device_qualifier =
176175// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete.
177176// device_qualifier descriptor describes information about a high-speed capable device that would
178177// change if the device were operating at the other speed. If not highspeed capable stall this request.
179- uint8_t const * tud_descriptor_device_qualifier_cb (void )
180- {
178+ uint8_t const * tud_descriptor_device_qualifier_cb (void ) {
181179 return (uint8_t const * ) & desc_device_qualifier ;
182180}
183181
184182// Invoked when received GET OTHER SEED CONFIGURATION DESCRIPTOR request
185183// Application return pointer to descriptor, whose contents must exist long enough for transfer to complete
186184// Configuration descriptor in the other speed e.g if high speed then this is for full speed and vice versa
187- uint8_t const * tud_descriptor_other_speed_configuration_cb (uint8_t index )
188- {
185+ uint8_t const * tud_descriptor_other_speed_configuration_cb (uint8_t index ) {
189186 (void ) index ; // for multiple configurations
190187
191188 // if link speed is high return fullspeed config, and vice versa
@@ -204,13 +201,12 @@ uint8_t const* tud_descriptor_other_speed_configuration_cb(uint8_t index)
204201// Invoked when received GET CONFIGURATION DESCRIPTOR
205202// Application return pointer to descriptor
206203// Descriptor contents must exist long enough for transfer to complete
207- uint8_t const * tud_descriptor_configuration_cb (uint8_t index )
208- {
204+ uint8_t const * tud_descriptor_configuration_cb (uint8_t index ) {
209205 (void ) index ; // for multiple configurations
210206
211207#if TUD_OPT_HIGH_SPEED
212208 // Although we are highspeed, host may be fullspeed.
213- return (tud_speed_get () == TUSB_SPEED_HIGH ) ? desc_hs_configuration : desc_fs_configuration ;
209+ return (tud_speed_get () == TUSB_SPEED_HIGH ) ? desc_hs_configuration : desc_fs_configuration ;
214210#else
215211 return desc_fs_configuration ;
216212#endif
@@ -229,8 +225,7 @@ enum {
229225};
230226
231227// array of pointer to string descriptors
232- char const * string_desc_arr [] =
233- {
228+ char const * string_desc_arr [] = {
234229 (const char []) { 0x09 , 0x04 }, // 0: is supported language is English (0x0409)
235230 "TinyUSB" , // 1: Manufacturer
236231 "TinyUSB Device" , // 2: Product
@@ -261,14 +256,14 @@ uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
261256 // Note: the 0xEE index string is a Microsoft OS 1.0 Descriptors.
262257 // https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/microsoft-defined-usb-descriptors
263258
264- if ( !(index < sizeof (string_desc_arr ) / sizeof (string_desc_arr [0 ])) ) return NULL ;
259+ if ( !(index < sizeof (string_desc_arr ) / sizeof (string_desc_arr [0 ])) ) { return NULL ; }
265260
266261 const char * str = string_desc_arr [index ];
267262
268263 // Cap at max char
269264 chr_count = strlen (str );
270265 size_t const max_count = sizeof (_desc_str ) / sizeof (_desc_str [0 ]) - 1 ; // -1 for string type
271- if ( chr_count > max_count ) chr_count = max_count ;
266+ if ( chr_count > max_count ) { chr_count = max_count ; }
272267
273268 // Convert ASCII string into UTF-16
274269 for ( size_t i = 0 ; i < chr_count ; i ++ ) {
@@ -279,6 +274,5 @@ uint16_t const *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
279274
280275 // first byte is length (including header), second byte is string type
281276 _desc_str [0 ] = (uint16_t ) ((TUSB_DESC_STRING << 8 ) | (2 * chr_count + 2 ));
282-
283277 return _desc_str ;
284278}
0 commit comments