Skip to content

Commit fded44d

Browse files
committed
fix(build): Limit support to IDF v5.4 or newer
1 parent a146449 commit fded44d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i
283283

284284
esp_eth_phy_t *phy = NULL;
285285
switch (type) {
286+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
286287
case ETH_PHY_GENERIC: phy = esp_eth_phy_new_generic(&phy_config); break;
288+
#endif
287289
case ETH_PHY_LAN8720: phy = esp_eth_phy_new_lan87xx(&phy_config); break;
288290
case ETH_PHY_TLK110: phy = esp_eth_phy_new_ip101(&phy_config); break;
289291
case ETH_PHY_RTL8201: phy = esp_eth_phy_new_rtl8201(&phy_config); break;

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
#ifndef _ETH_H_
2525
#define _ETH_H_
26+
#include "esp_idf_version.h"
2627

2728
//
2829
// Example configurations for pins_arduino.h to allow starting with ETH.begin();
@@ -78,7 +79,6 @@
7879

7980
#if CONFIG_ETH_USE_ESP32_EMAC
8081
#define ETH_PHY_IP101 ETH_PHY_TLK110
81-
#define ETH_PHY_JL1101 ETH_PHY_GENERIC
8282
#if CONFIG_IDF_TARGET_ESP32
8383
typedef enum {
8484
ETH_CLOCK_GPIO0_IN,
@@ -128,7 +128,10 @@ typedef emac_rmii_clock_mode_t eth_clock_mode_t;
128128

129129
typedef enum {
130130
#if CONFIG_ETH_USE_ESP32_EMAC
131+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
131132
ETH_PHY_GENERIC,
133+
#define ETH_PHY_JL1101 ETH_PHY_GENERIC
134+
#endif
132135
ETH_PHY_LAN8720,
133136
ETH_PHY_TLK110,
134137
ETH_PHY_RTL8201,

0 commit comments

Comments
 (0)