mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
fix(usb_host): Update log level and error poropagation
This commit is contained in:
parent
9ec1042dff
commit
3362e18432
@ -1309,7 +1309,6 @@ esp_err_t ext_hub_new_dev(uint8_t dev_addr)
|
|||||||
|
|
||||||
ret = find_first_intf_desc(config_desc, &hub_config);
|
ret = find_first_intf_desc(config_desc, &hub_config);
|
||||||
if (ret != ESP_OK) {
|
if (ret != ESP_OK) {
|
||||||
ESP_LOGE(EXT_HUB_TAG, "Finding HUB interface error %s", esp_err_to_name(ret));
|
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +97,6 @@ esp_err_t ext_hub_uninstall(void);
|
|||||||
* Entry:
|
* Entry:
|
||||||
* - should be called within Hub Driver
|
* - should be called within Hub Driver
|
||||||
*
|
*
|
||||||
* @param[in] config External Hub driver configuration
|
|
||||||
*
|
|
||||||
* @return
|
* @return
|
||||||
* - Unique pointer to identify the External Hub as a USB Host client
|
* - 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
|
* @return
|
||||||
* - ESP_OK: All devices freed
|
* - 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);
|
esp_err_t ext_hub_all_free(void);
|
||||||
|
|
||||||
|
@ -1033,16 +1033,10 @@ esp_err_t usb_host_device_free_all(void)
|
|||||||
HOST_EXIT_CRITICAL();
|
HOST_EXIT_CRITICAL();
|
||||||
esp_err_t ret;
|
esp_err_t ret;
|
||||||
#if ENABLE_USB_HUBS
|
#if ENABLE_USB_HUBS
|
||||||
ret = hub_notify_all_free();
|
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));
|
|
||||||
}
|
|
||||||
#endif // ENABLE_USB_HUBS
|
#endif // ENABLE_USB_HUBS
|
||||||
ret = usbh_devs_mark_all_free();
|
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 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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
static inline void handle_prop_gone_evt(device_t *dev_obj)
|
||||||
{
|
{
|
||||||
// Flush EP0's pipe. Then propagate a USBH_EVENT_DEV_GONE event
|
// 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 = {
|
usbh_event_data_t event_data = {
|
||||||
.event = USBH_EVENT_DEV_GONE,
|
.event = USBH_EVENT_DEV_GONE,
|
||||||
.dev_gone_data = {
|
.dev_gone_data = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user