LAN8720 fix

This commit is contained in:
technyon
2024-08-17 06:08:05 +02:00
parent e8fd17daf2
commit 3a0c92472c
2 changed files with 9 additions and 3 deletions

View File

@@ -132,11 +132,12 @@ void EthernetDevice::initialize()
{
Log->println(F("Ethernet hardware Initialized"));
if(!_ipConfiguration->dhcpEnabled())
if(_useSpi && !_ipConfiguration->dhcpEnabled())
{
ETH.config(_ipConfiguration->ipAddress(), _ipConfiguration->defaultGateway(), _ipConfiguration->subnet(), _ipConfiguration->dnsServer());
}
Network.onEvent([&](arduino_event_id_t event, arduino_event_info_t info)
{
switch (event) {
@@ -188,11 +189,16 @@ void EthernetDevice::initialize()
onDisconnected();
break;
default:
Log->print("ETH Event: ");
Log->println(event);
break;
}
});
}
else Log->println(F("Failed to initialize ethernet hardware"));
else
{
Log->println(F("Failed to initialize ethernet hardware"));
}
}
void EthernetDevice::reconfigure()