Skip to content

Commit

Permalink
fix(esp_tinyusb): Uninstall with external TinyUSB task
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-jam committed Jan 15, 2025
1 parent d381c29 commit bb9ab4a
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions device/esp_tinyusb/tinyusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,11 @@ esp_err_t tinyusb_driver_install(const tinyusb_config_t *config)

esp_err_t tinyusb_driver_uninstall(void)
{
esp_err_t ret = tusb_stop_task();

if (ret != ESP_OK) {
return ret;
}

if (!tusb_teardown()) {
return ESP_ERR_NOT_FINISHED;
}

#if !CONFIG_TINYUSB_NO_DEFAULT_TASK
ESP_RETURN_ON_ERROR(tusb_stop_task(), TAG, "Unable to stop TinyUSB task");
#endif // !CONFIG_TINYUSB_NO_DEFAULT_TASK
ESP_RETURN_ON_FALSE(tusb_teardown(), ESP_ERR_NOT_FINISHED, TAG, "Unable to teardown TinyUSB");
tinyusb_free_descriptors();
return usb_del_phy(phy_hdl);
ESP_RETURN_ON_ERROR(usb_del_phy(phy_hdl), TAG, "Unable to delete PHY");
return ESP_OK;
}

0 comments on commit bb9ab4a

Please sign in to comment.