@@ -424,12 +424,6 @@ static bool tinyusb_load_enabled_interfaces(){
424
424
log_e ("Descriptor Load Failed" );
425
425
return false;
426
426
} else {
427
- if (i == USB_INTERFACE_CDC ){
428
- if (!tinyusb_reserve_out_endpoint (3 ) || !tinyusb_reserve_in_endpoint (4 ) || !tinyusb_reserve_in_endpoint (5 )){
429
- log_e ("CDC Reserve Endpoints Failed" );
430
- return false;
431
- }
432
- }
433
427
dst += len ;
434
428
}
435
429
}
@@ -505,6 +499,7 @@ static void tinyusb_apply_device_config(tinyusb_device_config_t *config){
505
499
&& (config -> usb_class != TUSB_CLASS_CDC )
506
500
){
507
501
config -> usb_class = TUSB_CLASS_CDC ;
502
+ config -> usb_protocol = 0x00 ;
508
503
}
509
504
510
505
WEBUSB_ENABLED = config -> webusb_enabled ;
@@ -573,6 +568,12 @@ esp_err_t tinyusb_enable_interface(tinyusb_interface_t interface, uint16_t descr
573
568
log_e ("Interface %s invalid or already enabled" , (interface >= USB_INTERFACE_MAX )?"" :tinyusb_interface_names [interface ]);
574
569
return ESP_FAIL ;
575
570
}
571
+ if (interface == USB_INTERFACE_CDC ){
572
+ if (!tinyusb_reserve_out_endpoint (3 ) || !tinyusb_reserve_in_endpoint (4 ) || !tinyusb_reserve_in_endpoint (5 )){
573
+ log_e ("CDC Reserve Endpoints Failed" );
574
+ return ESP_FAIL ;
575
+ }
576
+ }
576
577
tinyusb_loaded_interfaces_mask |= (1U << interface );
577
578
tinyusb_config_descriptor_len += descriptor_len ;
578
579
tinyusb_loaded_interfaces_callbacks [interface ] = cb ;
@@ -586,7 +587,7 @@ esp_err_t tinyusb_init(tinyusb_device_config_t *config) {
586
587
}
587
588
tinyusb_is_initialized = true;
588
589
589
- tinyusb_endpoints .val = 0 ;
590
+ // tinyusb_endpoints.val = 0;
590
591
tinyusb_apply_device_config (config );
591
592
if (!tinyusb_load_enabled_interfaces ()) {
592
593
tinyusb_is_initialized = false;
0 commit comments