[tinyusb] Fix regression from bump to 2.x in #14796 (#14848)

This commit is contained in:
Keith Burzinski
2026-03-16 00:04:07 -05:00
committed by GitHub
parent 9948adc6a0
commit c09edb94c1

View File

@@ -2,6 +2,7 @@
#include "tinyusb_component.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include "tinyusb_default_config.h"
namespace esphome::tinyusb {
@@ -15,19 +16,19 @@ void TinyUSB::setup() {
this->string_descriptor_[SERIAL_NUMBER] = mac_addr_buf;
}
this->tusb_cfg_ = {
.port = TINYUSB_PORT_FULL_SPEED_0,
.phy = {.skip_setup = false},
.descriptor =
{
.device = &this->usb_descriptor_,
.string = this->string_descriptor_,
.string_count = SIZE,
},
// Start from esp_tinyusb defaults to keep required task settings valid across esp_tinyusb updates.
this->tusb_cfg_ = TINYUSB_DEFAULT_CONFIG();
this->tusb_cfg_.port = TINYUSB_PORT_FULL_SPEED_0;
this->tusb_cfg_.phy.skip_setup = false;
this->tusb_cfg_.descriptor = {
.device = &this->usb_descriptor_,
.string = this->string_descriptor_,
.string_count = SIZE,
};
esp_err_t result = tinyusb_driver_install(&this->tusb_cfg_);
if (result != ESP_OK) {
ESP_LOGE(TAG, "tinyusb_driver_install failed: %s", esp_err_to_name(result));
this->mark_failed();
}
}