mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
refactor(ext_hub): Device release (allows to run usb_host test with ext hub)
754d357frefactor(ext_hub): Fixed device release, optimized the order of closing usbh devicefc61875arefactor(ext_hub): Pospone the device release, if device is not IDLE3fd17b8brefactor(hub): Applied new ext_hub api, refactor func names3003362brefactor(usb_host): Cancel hub porpagation to the user, rename non-critical func19ce9ed6refactor(test_usb_host_async): Added host_lib_task finish notificationf238d75brefactor(ext_port): Remove the error verification, as error will be handled in ext hub driver Co-authored-by: Roman Leonov <roman.leonov@espressif.com>
This commit is contained in:
@@ -767,7 +767,7 @@ esp_err_t hub_port_disable(usb_device_handle_t parent_dev_hdl, uint8_t parent_po
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t hub_notify_new_dev(uint8_t dev_addr)
|
||||
esp_err_t hub_dev_new(uint8_t dev_addr)
|
||||
{
|
||||
HUB_DRIVER_ENTER_CRITICAL();
|
||||
HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE);
|
||||
@@ -790,15 +790,15 @@ esp_err_t hub_notify_new_dev(uint8_t dev_addr)
|
||||
}
|
||||
}
|
||||
// Close device
|
||||
usbh_dev_close(dev_hdl);
|
||||
ESP_ERROR_CHECK(usbh_dev_close(dev_hdl));
|
||||
}
|
||||
// Logic should not stop the flow, so no error to return
|
||||
ret = ESP_OK;
|
||||
// Nothing to do, while Hubs support is not enabled
|
||||
ret = ESP_ERR_NOT_SUPPORTED;
|
||||
#endif // ENABLE_USB_HUBS
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t hub_notify_dev_gone(uint8_t dev_addr)
|
||||
esp_err_t hub_dev_gone(uint8_t dev_addr)
|
||||
{
|
||||
HUB_DRIVER_ENTER_CRITICAL();
|
||||
HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE);
|
||||
@@ -809,7 +809,7 @@ esp_err_t hub_notify_dev_gone(uint8_t dev_addr)
|
||||
ret = ext_hub_dev_gone(dev_addr);
|
||||
#else
|
||||
// Nothing to do, while Hubs support is not enabled
|
||||
ret = ESP_OK;
|
||||
ret = ESP_ERR_NOT_SUPPORTED;
|
||||
#endif // ENABLE_USB_HUBS
|
||||
return ret;
|
||||
}
|
||||
@@ -821,7 +821,9 @@ esp_err_t hub_notify_all_free(void)
|
||||
HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE);
|
||||
HUB_DRIVER_EXIT_CRITICAL();
|
||||
|
||||
return ext_hub_all_free();
|
||||
ext_hub_mark_all_free();
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
#endif // ENABLE_USB_HUBS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user