Skip to content

Commit f706c27

Browse files
committed
Update TinyUSB init method
1 parent 592c994 commit f706c27

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cores/esp32/esp32-hal-tinyusb.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,15 @@ void deinit_usb_hal() {
173173

174174
esp_err_t tinyusb_driver_install(const tinyusb_config_t *config) {
175175
init_usb_hal(config->external_phy);
176+
tusb_rhport_init_t tinit;
177+
memset(&tinit, 0, sizeof(tusb_rhport_init_t));
178+
tinit.role = TUSB_ROLE_DEVICE;
176179
#if CONFIG_IDF_TARGET_ESP32P4
177-
if (!tusb_init(1, TUSB_ROLE_DEVICE)) {
180+
tinit.speed = TUSB_SPEED_HIGH;
181+
if (!tusb_init(1, &tinit)) {
178182
#else
179-
if (!tusb_init(0, TUSB_ROLE_DEVICE)) {
183+
tinit.speed = TUSB_SPEED_FULL;
184+
if (!tusb_init(0, &tinit)) {
180185
#endif
181186
log_e("Can't initialize the TinyUSB stack.");
182187
return ESP_FAIL;

0 commit comments

Comments
 (0)