From e4acfbc54ac6c07c9b05f03d00b0f15d6a7e221e Mon Sep 17 00:00:00 2001 From: liebman Date: Fri, 1 Oct 2021 04:38:45 -0700 Subject: [PATCH] only use ksz8081 for idf versions later than 4.3 (this fixes compile as component for idf 4.3) (#5599) esp_eth_phy_new_ksz8081 was added in IDF after version 4.3 and generates a compilation error with IDF-4.3. This change will only use esp_eth_phy_new_ksz8081 for IDF versions after 4.3 --- libraries/WiFi/src/ETH.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/WiFi/src/ETH.cpp b/libraries/WiFi/src/ETH.cpp index 092d6a3d..cb5ad7a8 100644 --- a/libraries/WiFi/src/ETH.cpp +++ b/libraries/WiFi/src/ETH.cpp @@ -288,7 +288,12 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ break; #endif case ETH_PHY_KSZ8081: +#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4,3,0) eth_phy = esp_eth_phy_new_ksz8081(&phy_config); +#else + log_e("unsupported ethernet type 'ETH_PHY_KSZ8081'"); +#endif + break; default: break; }