Skip to content

Commit 065d492

Browse files
authored
Revert "Disable Ethernet library if CONFIG_ETH_ENABLED not defined in sdkconfig.h (espressif#8595)" (#266)
This reverts commit fff900d.
1 parent 57bfbb6 commit 065d492

File tree

4 files changed

+0
-16
lines changed

4 files changed

+0
-16
lines changed

Diff for: libraries/Ethernet/src/ETH.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
*/
2020

21-
#include "sdkconfig.h"
22-
#ifdef CONFIG_ETH_ENABLED
23-
2421
#include "ETH.h"
2522
#include "esp_system.h"
2623
#if ESP_IDF_VERSION_MAJOR > 3
@@ -607,5 +604,3 @@ String ETHClass::macAddress(void)
607604
}
608605

609606
ETHClass ETH;
610-
611-
#endif // CONFIG_ETH_ENABLED

Diff for: libraries/Ethernet/src/ETH.h

-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
#ifndef _ETH_H_
2222
#define _ETH_H_
2323

24-
#include "sdkconfig.h"
25-
#ifdef CONFIG_ETH_ENABLED
26-
2724
#include "WiFi.h"
2825
#include "esp_system.h"
2926
#include "esp_eth.h"
@@ -109,6 +106,4 @@ class ETHClass {
109106

110107
extern ETHClass ETH;
111108

112-
#endif // CONFIG_ETH_ENABLED
113-
114109
#endif /* _ETH_H_ */

Diff for: libraries/WiFi/src/WiFiGeneric.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,6 @@ static void _arduino_event_cb(void* arg, esp_event_base_t event_base, int32_t ev
426426
/*
427427
* ETH
428428
* */
429-
#ifdef CONFIG_ETH_ENABLED
430429
} else if (event_base == ETH_EVENT && event_id == ETHERNET_EVENT_CONNECTED) {
431430
log_v("Ethernet Link Up");
432431
arduino_event.event_id = ARDUINO_EVENT_ETH_CONNECTED;
@@ -447,7 +446,6 @@ static void _arduino_event_cb(void* arg, esp_event_base_t event_base, int32_t ev
447446
#endif
448447
arduino_event.event_id = ARDUINO_EVENT_ETH_GOT_IP;
449448
memcpy(&arduino_event.event_info.got_ip, event_data, sizeof(ip_event_got_ip_t));
450-
#endif // CONFIG_ETH_ENABLED
451449

452450
/*
453451
* IPv6
@@ -596,12 +594,10 @@ static bool _start_network_event_task(){
596594
return false;
597595
}
598596

599-
#ifdef CONFIG_ETH_ENABLED
600597
if(esp_event_handler_instance_register(ETH_EVENT, ESP_EVENT_ANY_ID, &_arduino_event_cb, NULL, NULL)){
601598
log_e("event_handler_instance_register for ETH_EVENT Failed!");
602599
return false;
603600
}
604-
#endif // CONFIG_ETH_ENABLED
605601

606602
if(esp_event_handler_instance_register(WIFI_PROV_EVENT, ESP_EVENT_ANY_ID, &_arduino_event_cb, NULL, NULL)){
607603
log_e("event_handler_instance_register for WIFI_PROV_EVENT Failed!");

Diff for: libraries/WiFi/src/WiFiGeneric.h

-2
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,7 @@ typedef union {
9292
ip_event_got_ip_t got_ip;
9393
ip_event_got_ip6_t got_ip6;
9494
smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd;
95-
#ifdef CONFIG_ETH_ENABLED
9695
esp_eth_handle_t eth_connected;
97-
#endif
9896
wifi_sta_config_t prov_cred_recv;
9997
wifi_prov_sta_fail_reason_t prov_fail_reason;
10098
} arduino_event_info_t;

0 commit comments

Comments
 (0)