Skip to content

Commit

Permalink
Update TinyUSB init method
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev committed Oct 15, 2024
1 parent 592c994 commit f706c27
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cores/esp32/esp32-hal-tinyusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,15 @@ void deinit_usb_hal() {

esp_err_t tinyusb_driver_install(const tinyusb_config_t *config) {
init_usb_hal(config->external_phy);
tusb_rhport_init_t tinit;
memset(&tinit, 0, sizeof(tusb_rhport_init_t));
tinit.role = TUSB_ROLE_DEVICE;
#if CONFIG_IDF_TARGET_ESP32P4
if (!tusb_init(1, TUSB_ROLE_DEVICE)) {
tinit.speed = TUSB_SPEED_HIGH;
if (!tusb_init(1, &tinit)) {
#else
if (!tusb_init(0, TUSB_ROLE_DEVICE)) {
tinit.speed = TUSB_SPEED_FULL;
if (!tusb_init(0, &tinit)) {
#endif
log_e("Can't initialize the TinyUSB stack.");
return ESP_FAIL;
Expand Down

0 comments on commit f706c27

Please sign in to comment.