Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard ethernet parts to make it possible to use without #10609

Open
wants to merge 4 commits into
base: release/v3.1.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libraries/Ethernet/src/ETH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1056,3 +1060,5 @@ size_t ETHClass::printDriverInfo(Print &out) const {
}

ETHClass ETH;

#endif /* CONFIG_ETH_ENABLED */
4 changes: 4 additions & 0 deletions libraries/Ethernet/src/ETH.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_

Expand Down Expand Up @@ -249,3 +252,4 @@ class ETHClass : public NetworkInterface {
extern ETHClass ETH;

#endif /* _ETH_H_ */
#endif /* CONFIG_ETH_ENABLED */
6 changes: 5 additions & 1 deletion libraries/Network/src/NetworkEvents.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <functional>
#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 <mutex>
#endif // defined NETWORK_EVENTS_MUTEX && SOC_CPU_CORES_NUM > 1
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions libraries/WiFi/src/WiFiGeneric.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading