Fix m5 poeunit (#633)

* fix m5stack poe ethernet device initialiazation

* move m5stack instantiation inside compile time check

* fix include path
This commit is contained in:
Jan-Ole Schümann
2025-03-03 19:37:01 +07:00
committed by GitHub
parent 603844b4e9
commit 2fbecc3e13
5 changed files with 23 additions and 12 deletions

View File

@@ -6,6 +6,7 @@
#include "../PreferencesKeys.h"
#include "NetworkUtil.h"
#include "../networkDevices/LAN8720Definitions.h"
#include "../networkDevices/Tlk110Definitions.h"
NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDeviceType, String hostname, Preferences *preferences, IPConfiguration *ipConfiguration)
{
@@ -57,17 +58,6 @@ NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDevice
ETH_PHY_SPI_MOSI_ETH01EVO,
ETH_PHY_TYPE_DM9051);
break;
case NetworkDeviceType::M5STACK_PoESP32_Unit:
device = new EthernetDevice(hostname, preferences, ipConfiguration, "M5STACK PoESP32 Unit",
ETH_PHY_ADDR_W5500,
ETH_PHY_CS_M5_W5500,
ETH_PHY_IRQ_M5_W5500,
ETH_PHY_RST_M5_W5500,
ETH_PHY_SPI_SCK_M5_W5500,
ETH_PHY_SPI_MISO_M5_W5500,
ETH_PHY_SPI_MOSI_M5_W5500,
ETH_PHY_W5500);
break;
case NetworkDeviceType::LilyGO_T_ETH_ELite:
device = new EthernetDevice(hostname, preferences, ipConfiguration, "LilyGO T-ETH ELite",
ETH_PHY_ADDR_W5500,
@@ -139,6 +129,15 @@ NetworkDevice *NetworkDeviceInstantiator::Create(NetworkDeviceType networkDevice
}
break;
#if defined(CONFIG_IDF_TARGET_ESP32)
case NetworkDeviceType::M5STACK_PoESP32_Unit:
device = new EthernetDevice(hostname, preferences, ipConfiguration, "M5STACK PoESP32 Unit",
ETH_PHY_ADDR_M5_POESP32,
ETH_PHY_POWER_M5_POESP32,
ETH_PHY_MDC_M5_POESP32,
ETH_PHY_MDIO_M5_POESP32,
ETH_CLK_MODE_M5_TYPE,
ETH_CLK_MODE_M5_POESP32);
break;
case NetworkDeviceType::Olimex_LAN8720:
device = new EthernetDevice(hostname, preferences, ipConfiguration, "Olimex (LAN8720)", ETH_PHY_ADDR_LAN8720, 12, ETH_PHY_MDC_LAN8720, ETH_PHY_MDIO_LAN8720, ETH_PHY_TYPE_LAN8720, ETH_CLOCK_GPIO17_OUT);
break;