Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 40fe144

Browse filesBrowse files
authored
Merge pull request #7 from adafruit/fix-usb-v4.2
temporarily walkaround for tinyusb init for v4.2
2 parents 961b038 + d3468d3 commit 40fe144
Copy full SHA for 40fe144

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed

‎cores/esp32/esp32-hal-tinyusb.c

Copy file name to clipboardExpand all lines: cores/esp32/esp32-hal-tinyusb.c
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,22 @@ 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+
539540
esp_err_t err = tinyusb_driver_install(&tusb_cfg);
541+
542+
#if 1 // walkaround for v4.2 tinyusb init bug
543+
// Note: IDF v4.2 has a bug that incorrectly check the tusb_init() returned value (bool instead of error code)
544+
// https://github.com/espressif/esp-idf/blob/release/v4.2/components/tinyusb/port/esp32s2/src/tinyusb.c#L89
545+
// This is due to a internal bug of tinyusb stack which is fixed recently.
546+
// This is fixed in IDF v4.3 and should be reverted when 4.3 is released
547+
err = ESP_OK;
548+
#endif
549+
540550
if (err != ESP_OK) {
541551
initialized = false;
542552
return err;
543553
}
554+
544555
xTaskCreate(usb_device_task, "usbd", 4096, NULL, configMAX_PRIORITIES - 1, NULL);
545556
return err;
546557
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.