mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
esp_eth: Add CONFIG_ETH_ENABLED flag to enable/disable ethernet at build time
Always enabled by default, as SPI/Ethernet support is enabled by default.
This commit is contained in:
committed by
Angus Gratton
parent
f58d2ea34d
commit
e32d27e7e8
@@ -1,20 +1,30 @@
|
||||
set(esp_eth_srcs "src/esp_eth.c"
|
||||
"src/esp_eth_phy_dp83848.c"
|
||||
"src/esp_eth_phy_ip101.c"
|
||||
"src/esp_eth_phy_lan8720.c"
|
||||
"src/esp_eth_phy_rtl8201.c")
|
||||
set(srcs) # If ethernet disabled in Kconfig, this is a config-only component
|
||||
set(include)
|
||||
set(linker)
|
||||
|
||||
if(CONFIG_ETH_USE_ESP32_EMAC)
|
||||
list(APPEND esp_eth_srcs "src/esp_eth_mac_esp32.c")
|
||||
if(CONFIG_ETH_ENABLED)
|
||||
set(srcs "src/esp_eth.c")
|
||||
set(include "include")
|
||||
set(linker "linker.lf")
|
||||
|
||||
if(CONFIG_ETH_USE_ESP32_EMAC)
|
||||
list(APPEND srcs "src/esp_eth_mac_esp32.c"
|
||||
"src/esp_eth_phy_dp83848.c"
|
||||
"src/esp_eth_phy_ip101.c"
|
||||
"src/esp_eth_phy_lan8720.c"
|
||||
"src/esp_eth_phy_rtl8201.c"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ETH_SPI_ETHERNET_DM9051)
|
||||
list(APPEND srcs "src/esp_eth_mac_dm9051.c"
|
||||
"src/esp_eth_phy_dm9051.c")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_ETH_SPI_ETHERNET_DM9051)
|
||||
list(APPEND esp_eth_srcs "src/esp_eth_mac_dm9051.c"
|
||||
"src/esp_eth_phy_dm9051.c")
|
||||
endif()
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS ${include}
|
||||
LDFRAGMENTS ${linker}
|
||||
REQUIRES "esp_event"
|
||||
PRIV_REQUIRES "tcpip_adapter" "driver" "log")
|
||||
|
||||
idf_component_register(SRCS "${esp_eth_srcs}"
|
||||
INCLUDE_DIRS "include"
|
||||
LDFRAGMENTS "linker.lf"
|
||||
REQUIRES "esp_event"
|
||||
PRIV_REQUIRES "tcpip_adapter" "driver" "log")
|
||||
|
||||
Reference in New Issue
Block a user