Merge branch 'refactor/usb_host_build_dependency_options' into 'master'

USB Host: Remove CONFIG_USB_OTG_SUPPORTED, build dependencies use SOC_USB_OTG_SUPPORTED instead

See merge request espressif/esp-idf!28097
pull/12901/merge
Darian 2024-01-02 17:03:29 +08:00
commit bc503f987f
3 zmienionych plików z 17 dodań i 20 usunięć

Wyświetl plik

@ -107,7 +107,7 @@ menu "PHY"
config ESP_PHY_ENABLE_USB
bool "Enable USB when phy init"
depends on USB_OTG_SUPPORTED || ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
depends on SOC_USB_OTG_SUPPORTED || ESP_CONSOLE_USB_SERIAL_JTAG || ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG
default y if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
default n
help

Wyświetl plik

@ -6,13 +6,13 @@ endif()
set(srcs)
set(include)
set(priv_include)
# As CONFIG_USB_OTG_SUPPORTED comes from Kconfig, it is not evaluated yet
set(priv_includes)
# As CONFIG_SOC_USB_OTG_SUPPORTED comes from Kconfig, it is not evaluated yet
# when components are being registered.
# Thus, always add the (private) requirements, regardless of Kconfig
set(priv_require esp_driver_gpio) # usb_phy driver relies on gpio driver API
set(priv_requires esp_driver_gpio) # usb_phy driver relies on gpio driver API
if(CONFIG_USB_OTG_SUPPORTED)
if(CONFIG_SOC_USB_OTG_SUPPORTED)
list(APPEND srcs "hcd_dwc.c"
"hub.c"
"usb_helpers.c"
@ -21,11 +21,11 @@ if(CONFIG_USB_OTG_SUPPORTED)
"usbh.c"
"usb_phy.c")
list(APPEND include "include")
list(APPEND priv_include "private_include")
list(APPEND priv_includes "private_include")
endif()
idf_component_register(SRCS ${srcs}
INCLUDE_DIRS ${include}
PRIV_INCLUDE_DIRS ${priv_include}
PRIV_REQUIRES ${priv_require}
PRIV_INCLUDE_DIRS ${priv_includes}
PRIV_REQUIRES ${priv_requires}
)

Wyświetl plik

@ -1,13 +1,7 @@
menu "USB-OTG"
visible if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
# Invisible item, enabled when USB_OTG peripheral does exist
config USB_OTG_SUPPORTED
bool
default y if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3
depends on SOC_USB_OTG_SUPPORTED
config USB_HOST_CONTROL_TRANSFER_MAX_SIZE
depends on USB_OTG_SUPPORTED
int "Largest size (in bytes) of transfers to/from default endpoints"
default 256
help
@ -18,7 +12,6 @@ menu "USB-OTG"
- Device's with configuration descriptors larger than this limit cannot be supported
choice USB_HOST_HW_BUFFER_BIAS
depends on USB_OTG_SUPPORTED
prompt "Hardware FIFO size biasing"
default USB_HOST_HW_BUFFER_BIAS_BALANCED
help
@ -56,7 +49,6 @@ menu "USB-OTG"
menu "Root Hub configuration"
config USB_HOST_DEBOUNCE_DELAY_MS
depends on USB_OTG_SUPPORTED
int "Debounce delay in ms"
default 250
help
@ -67,7 +59,6 @@ menu "USB-OTG"
The default value is set to 250 ms to be safe.
config USB_HOST_RESET_HOLD_MS
depends on USB_OTG_SUPPORTED
int "Reset hold in ms"
default 30
help
@ -79,7 +70,6 @@ menu "USB-OTG"
The default value is set to 30 ms to be safe.
config USB_HOST_RESET_RECOVERY_MS
depends on USB_OTG_SUPPORTED
int "Reset recovery delay in ms"
default 30
help
@ -92,7 +82,6 @@ menu "USB-OTG"
config USB_HOST_SET_ADDR_RECOVERY_MS
depends on USB_OTG_SUPPORTED
int "SetAddress() recovery time in ms"
default 10
help
@ -107,4 +96,12 @@ menu "USB-OTG"
endmenu #Root Hub configuration
# Hidden or compatibility options
config USB_OTG_SUPPORTED
# Invisible config kept for compatibility
# Todo: Remove in v6.0 (IDF-8936)
bool
default y
endmenu #USB-OTG