refactor(ext_port): Changed the mechanism for hub class request

Merged all Hub Class specific request to one function.
Added a callback for the External Port Driver to break the dependency from ext_hub.h
This commit is contained in:
Roman Leonov
2025-02-19 14:05:24 +01:00
parent 9c98a17a0d
commit c391c835c2
6 changed files with 96 additions and 128 deletions

View File

@@ -314,7 +314,7 @@ static inline bool _buffer_check_done(pipe_t *pipe)
}
#if (CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3)
// The HW can't handle two transactions with preamble in one frame.
// TODO: IDF-15060
// TODO: IDF-12986
if (pipe->ep_char.ls_via_fs_hub) {
esp_rom_delay_us(1000);
}
@@ -1539,7 +1539,7 @@ static void pipe_set_ep_char(const hcd_pipe_config_t *pipe_config, usb_transfer_
ep_char->dev_addr = pipe_config->dev_addr;
ep_char->ls_via_fs_hub = 0;
if (pipe_idx > 0) {
// TODO: remove warning after IDF-15060
// TODO: remove warning after IDF-12986
if (port_speed == USB_SPEED_FULL && pipe_config->dev_speed == USB_SPEED_LOW) {
ESP_LOGW(HCD_DWC_TAG, "Low-speed, extra delay will be applied in ISR");
ep_char->ls_via_fs_hub = 1;