1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-24 21:21:24 +01:00

Check return of Ethernet.begin() in all code variants

This commit is contained in:
Harald Barth 2024-01-08 13:19:22 +01:00
parent 39d0cbb791
commit 70a1b9538c

View File

@ -59,15 +59,15 @@ EthernetInterface::EthernetInterface()
DCCTimer::getSimulatedMacAddress(mac); DCCTimer::getSimulatedMacAddress(mac);
connected=false; connected=false;
#ifdef IP_ADDRESS #ifdef IP_ADDRESS
Ethernet.begin(mac, IP_ADDRESS); if (Ethernet.begin(mac, IP_ADDRESS) == 0)
#else #else
if (Ethernet.begin(mac) == 0) if (Ethernet.begin(mac) == 0)
#endif
{ {
DIAG(F("Ethernet.begin FAILED")); DIAG(F("Ethernet.begin FAILED"));
return; return;
} }
#endif
if (Ethernet.hardwareStatus() == EthernetNoHardware) { if (Ethernet.hardwareStatus() == EthernetNoHardware) {
DIAG(F("Ethernet shield not found or W5100")); DIAG(F("Ethernet shield not found or W5100"));
} }