Skip to content

Commit 593515c

Browse files
committed
Fixed broken USB on ESP32-S2
1 parent beedeea commit 593515c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: cores/esp32/esp32-hal-tinyusb.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,15 @@ esp_err_t tinyusb_init(tinyusb_device_config_t *config) {
536536
tinyusb_config_t tusb_cfg = {
537537
.external_phy = false // In the most cases you need to use a `false` value
538538
};
539-
esp_err_t err = tinyusb_driver_install(&tusb_cfg);
540-
if (err != ESP_OK) {
539+
// NOTE: this returns esp_err_t but has a bug and actually ends up returning a bool,
540+
// so lets just pretend it's a bool for now
541+
bool ret = tinyusb_driver_install(&tusb_cfg);
542+
if (!ret) {
541543
initialized = false;
542-
return err;
544+
return ESP_FAIL;
543545
}
544546
xTaskCreate(usb_device_task, "usbd", 4096, NULL, configMAX_PRIORITIES - 1, NULL);
545-
return err;
547+
return ESP_OK;
546548
}
547549

548550
void usb_persist_restart(restart_type_t mode)

0 commit comments

Comments
 (0)