fix LAN8720 init

This commit is contained in:
technyon
2024-07-07 13:30:04 +02:00
parent accaa1e5c0
commit 53243fe045
2 changed files with 16 additions and 17 deletions

View File

@@ -78,13 +78,12 @@ void EthLan8720Device::initialize()
#if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0)) #if (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0))
_hardwareInitialized = ETH.begin(_phy_addr, _power, _mdc, _mdio, _type, _clock_mode, _use_mac_from_efuse); _hardwareInitialized = ETH.begin(_phy_addr, _power, _mdc, _mdio, _type, _clock_mode, _use_mac_from_efuse);
#else #elif CONFIG_IDF_TARGET_ESP32
#ifdef CONFIG_IDF_TARGET_ESP32 _hardwareInitialized = ETH.begin(_type, _phy_addr, _mdc, _mdio, _power, _clock_mode);
_hardwareInitialized = ETH.begin(_type, _phy_addr, _mdc, _mdio, ETH_RESET_PIN, _clock_mode);
#else #else
_hardwareInitialized = false; _hardwareInitialized = false;
#endif #endif
#endif
ETH.setHostname(_hostname.c_str()); ETH.setHostname(_hostname.c_str());
if(!_ipConfiguration->dhcpEnabled()) if(!_ipConfiguration->dhcpEnabled())
{ {

View File

@@ -2,11 +2,11 @@
#if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0)) #if (ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(5, 0, 0))
#ifndef CONFIG_IDF_TARGET_ESP32 #ifndef CONFIG_IDF_TARGET_ESP32
typedef enum { // typedef enum {
ETH_CLOCK_GPIO0_IN = 0, // ETH_CLOCK_GPIO0_IN = 0,
ETH_CLOCK_GPIO16_OUT = 2, // ETH_CLOCK_GPIO16_OUT = 2,
ETH_CLOCK_GPIO17_OUT = 3 // ETH_CLOCK_GPIO17_OUT = 3
} eth_clock_mode_t; // } eth_clock_mode_t;
#define ETH_PHY_TYPE ETH_PHY_MAX #define ETH_PHY_TYPE ETH_PHY_MAX
#else #else