From f14a6cf51b6666e9bbf273f9204ca0899d99d665 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Tue, 9 Apr 2019 19:34:38 +0800 Subject: [PATCH] Ethernet peripheral will depend on IDF_TARGET esp32 has EMAC controller, but esp32s2 doesn't --- components/ethernet/CMakeLists.txt | 2 ++ components/ethernet/Kconfig | 1 + components/ethernet/component.mk | 6 +++++- components/lwip/CMakeLists.txt | 7 +++++++ components/lwip/component.mk | 4 ++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/components/ethernet/CMakeLists.txt b/components/ethernet/CMakeLists.txt index 704d21a7d7..db4e8f672a 100644 --- a/components/ethernet/CMakeLists.txt +++ b/components/ethernet/CMakeLists.txt @@ -1,3 +1,5 @@ +require_idf_targets(esp32) + set(COMPONENT_SRCS "emac_dev.c" "emac_main.c" "eth_phy/phy_common.c" diff --git a/components/ethernet/Kconfig b/components/ethernet/Kconfig index 9444f78e43..02dcfa4ec3 100644 --- a/components/ethernet/Kconfig +++ b/components/ethernet/Kconfig @@ -1,4 +1,5 @@ menu Ethernet + depends on IDF_TARGET_ESP32 config ETH_DMA_RX_BUF_NUM int "Number of DMA RX buffers" diff --git a/components/ethernet/component.mk b/components/ethernet/component.mk index 0856e27d65..73bfbab96f 100644 --- a/components/ethernet/component.mk +++ b/components/ethernet/component.mk @@ -2,4 +2,8 @@ # Component Makefile # -COMPONENT_SRCDIRS := . eth_phy +ifdef CONFIG_IDF_TARGET_ESP32 + COMPONENT_SRCDIRS := . eth_phy +else + COMPONENT_CONFIG_ONLY := 1 +endif diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt index 6a15d6f5c8..0467902dc6 100644 --- a/components/lwip/CMakeLists.txt +++ b/components/lwip/CMakeLists.txt @@ -86,10 +86,17 @@ set(COMPONENT_SRCS "apps/dhcpserver/dhcpserver.c" "port/esp32/debug/lwip_debug.c" "port/esp32/freertos/sys_arch.c" "port/esp32/netif/dhcp_state.c" +<<<<<<< bce8b14e7324423a5caad1c6a240e97fdc45afe2 "port/esp32/netif/ethernetif.c" "port/esp32/netif/nettestif.c" +======= +>>>>>>> Ethernet peripheral will depend on IDF_TARGET "port/esp32/netif/wlanif.c") +if(CONFIG_IDF_TARGET_ESP32) + list(APPEND COMPONENT_SRCS "port/esp32/netif/ethernetif.c") +endif() + if(CONFIG_LWIP_PPP_SUPPORT) list(APPEND COMPONENT_SRCS "lwip/src/netif/ppp/auth.c" "lwip/src/netif/ppp/ccp.c" diff --git a/components/lwip/component.mk b/components/lwip/component.mk index a92b888693..65faad6290 100644 --- a/components/lwip/component.mk +++ b/components/lwip/component.mk @@ -25,6 +25,10 @@ COMPONENT_SRCDIRS := \ port/esp32/netif \ port/esp32/debug +ifndef CONFIG_IDF_TARGET_ESP32 + COMPONENT_OBJEXCLUDE := port/esp32/netif/ethernetif.o +endif + ifdef CONFIG_LWIP_PPP_SUPPORT COMPONENT_SRCDIRS += lwip/src/netif/ppp lwip/src/netif/ppp/polarssl endif