From f801b982c65d85a761b8d576780a9f152b83caec Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:45:17 +0100 Subject: [PATCH 1/6] Update ETH.cpp --- libraries/Ethernet/src/ETH.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 1bd8f367c3d..d85dde8970a 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -19,6 +19,10 @@ */ // Disable the automatic pin remapping of the API calls in this file + +#include "sdkconfig.h" +#if CONFIG_ETH_ENABLED + #define ARDUINO_CORE_BUILD #include "ETH.h" @@ -1056,3 +1060,5 @@ size_t ETHClass::printDriverInfo(Print &out) const { } ETHClass ETH; + +#endif /* CONFIG_ETH_ENABLED */ From f598aa2ae649298bd1288b061762cc83d2004b35 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:47:32 +0100 Subject: [PATCH 2/6] Update ETH.h --- libraries/Ethernet/src/ETH.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h index 10d6b504c2a..582835cf8ac 100644 --- a/libraries/Ethernet/src/ETH.h +++ b/libraries/Ethernet/src/ETH.h @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "sdkconfig.h" +#if CONFIG_ETH_ENABLED + #ifndef _ETH_H_ #define _ETH_H_ @@ -249,3 +252,4 @@ class ETHClass : public NetworkInterface { extern ETHClass ETH; #endif /* _ETH_H_ */ +#endif /* CONFIG_ETH_ENABLED */ From cd4c6d1e8e86aea1093306dffbaeca0eb06f355f Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:50:21 +0100 Subject: [PATCH 3/6] Update WiFiGeneric.h --- libraries/WiFi/src/WiFiGeneric.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/WiFi/src/WiFiGeneric.h b/libraries/WiFi/src/WiFiGeneric.h index 27b41043abf..ed216229ed4 100644 --- a/libraries/WiFi/src/WiFiGeneric.h +++ b/libraries/WiFi/src/WiFiGeneric.h @@ -33,7 +33,9 @@ #include "IPAddress.h" #include "esp_smartconfig.h" #include "esp_netif_types.h" +#if CONFIG_ETH_ENABLED #include "esp_eth_driver.h" +#endif #if CONFIG_NETWORK_PROV_NETWORK_TYPE_WIFI #include "network_provisioning/manager.h" #endif From 20493c17916d9b39e9033aa842303f87011e0f83 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:51:39 +0100 Subject: [PATCH 4/6] Update NetworkEvents.h --- libraries/Network/src/NetworkEvents.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/Network/src/NetworkEvents.h b/libraries/Network/src/NetworkEvents.h index a84ced88496..f1f5aaf4155 100644 --- a/libraries/Network/src/NetworkEvents.h +++ b/libraries/Network/src/NetworkEvents.h @@ -5,18 +5,20 @@ */ #pragma once +#include "sdkconfig.h" #include "soc/soc_caps.h" #include "esp_err.h" #include "esp_event.h" #include "esp_netif_types.h" +#if CONFIG_ETH_ENABLED #include "esp_eth_driver.h" +#endif #include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/queue.h" #include "freertos/semphr.h" #include "freertos/event_groups.h" -#include "sdkconfig.h" #if defined NETWORK_EVENTS_MUTEX && SOC_CPU_CORES_NUM > 1 #include #endif // defined NETWORK_EVENTS_MUTEX && SOC_CPU_CORES_NUM > 1 @@ -98,7 +100,9 @@ typedef union { ip_event_ap_staipassigned_t wifi_ap_staipassigned; ip_event_got_ip_t got_ip; ip_event_got_ip6_t got_ip6; +#if CONFIG_ETH_ENABLED esp_eth_handle_t eth_connected; +#endif #if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED wifi_event_sta_scan_done_t wifi_scan_done; wifi_event_sta_authmode_change_t wifi_sta_authmode_change; From 5815e99df362d3220158a7469c596e5d108c092b Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:00:20 +0100 Subject: [PATCH 5/6] remove unnecessary include "sdkconfig.h" --- libraries/Ethernet/src/ETH.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index d85dde8970a..fa8a2b97122 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -19,13 +19,10 @@ */ // Disable the automatic pin remapping of the API calls in this file - -#include "sdkconfig.h" -#if CONFIG_ETH_ENABLED - #define ARDUINO_CORE_BUILD #include "ETH.h" +#if CONFIG_ETH_ENABLED #include "esp_system.h" #include "esp_event.h" #include "esp_eth.h" From a7362a5211d72e28308b8fe89ff7f44a5972b65f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 12:45:03 +0000 Subject: [PATCH 6/6] ci(pre-commit): Apply automatic fixes --- libraries/Network/src/NetworkEvents.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Network/src/NetworkEvents.h b/libraries/Network/src/NetworkEvents.h index f1f5aaf4155..34a54cab092 100644 --- a/libraries/Network/src/NetworkEvents.h +++ b/libraries/Network/src/NetworkEvents.h @@ -100,7 +100,7 @@ typedef union { ip_event_ap_staipassigned_t wifi_ap_staipassigned; ip_event_got_ip_t got_ip; ip_event_got_ip6_t got_ip6; -#if CONFIG_ETH_ENABLED +#if CONFIG_ETH_ENABLED esp_eth_handle_t eth_connected; #endif #if SOC_WIFI_SUPPORTED || CONFIG_ESP_WIFI_REMOTE_ENABLED