Merge branch 'fix/usb_host_change_log_level' into 'master'

fix(usb_host): Update log level and error poropagation

See merge request espressif/esp-idf!33361
This commit is contained in:
Peter Marcisovsky 2024-09-11 22:37:24 +08:00
commit 2e100a3518
4 changed files with 3 additions and 12 deletions

View File

@ -1309,7 +1309,6 @@ esp_err_t ext_hub_new_dev(uint8_t dev_addr)
ret = find_first_intf_desc(config_desc, &hub_config);
if (ret != ESP_OK) {
ESP_LOGE(EXT_HUB_TAG, "Finding HUB interface error %s", esp_err_to_name(ret));
goto exit;
}

View File

@ -97,8 +97,6 @@ esp_err_t ext_hub_uninstall(void);
* Entry:
* - should be called within Hub Driver
*
* @param[in] config External Hub driver configuration
*
* @return
* - Unique pointer to identify the External Hub as a USB Host client
*/
@ -157,7 +155,7 @@ esp_err_t ext_hub_dev_gone(uint8_t dev_addr);
*
* @return
* - ESP_OK: All devices freed
* - ESP_ERR_INVALID_STATE: External Hub driver is not installed
* - ESP_ERR_NOT_FINISHED: Operation not finished: devices waiting children to be freed.
*/
esp_err_t ext_hub_all_free(void);

View File

@ -1033,16 +1033,10 @@ esp_err_t usb_host_device_free_all(void)
HOST_EXIT_CRITICAL();
esp_err_t ret;
#if ENABLE_USB_HUBS
ret = hub_notify_all_free();
if (ret != ESP_OK) {
ESP_LOGE(USB_HOST_TAG, "Marking all devices as free in HUB error: %s", esp_err_to_name(ret));
}
hub_notify_all_free();
#endif // ENABLE_USB_HUBS
ret = usbh_devs_mark_all_free();
// If ESP_ERR_NOT_FINISHED is returned, caller must wait for USB_HOST_LIB_EVENT_FLAGS_ALL_FREE to confirm all devices are free
if (ret != ESP_OK) {
ESP_LOGE(USB_HOST_TAG, "Marking all devices as free in USBH error: %s", esp_err_to_name(ret));
}
return ret;
}

View File

@ -574,7 +574,7 @@ static inline void handle_ep0_clear(device_t *dev_obj)
static inline void handle_prop_gone_evt(device_t *dev_obj)
{
// Flush EP0's pipe. Then propagate a USBH_EVENT_DEV_GONE event
ESP_LOGE(USBH_TAG, "Device %d gone", dev_obj->constant.address);
ESP_LOGD(USBH_TAG, "Device %d gone", dev_obj->constant.address);
usbh_event_data_t event_data = {
.event = USBH_EVENT_DEV_GONE,
.dev_gone_data = {