1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-27 01:56:14 +01:00

Ethernet init order

This commit is contained in:
Harald Barth 2022-11-04 15:39:35 +01:00
parent aca9c9c941
commit dd309a3705
2 changed files with 16 additions and 5 deletions

View File

@ -36,11 +36,11 @@ EthernetInterface * EthernetInterface::singleton=NULL;
*/ */
void EthernetInterface::setup() void EthernetInterface::setup()
{ {
if (Ethernet.hardwareStatus() == EthernetNoHardware) if (singleton!=NULL) {
DIAG(F("Ethernet shield not detected or is a W5100"));
if (singleton!=NULL)
DIAG(F("Prog Error!")); DIAG(F("Prog Error!"));
if (singleton=new EthernetInterface()) return;
}
if ((singleton=new EthernetInterface()))
return; return;
DIAG(F("Ethernet not initialized")); DIAG(F("Ethernet not initialized"));
}; };
@ -67,6 +67,16 @@ EthernetInterface::EthernetInterface()
return; return;
} }
#endif #endif
if (Ethernet.hardwareStatus() == EthernetNoHardware)
DIAG(F("Ethernet shield not detected or is a W5100"));
unsigned long startmilli = millis();
while ((millis() - startmilli) < 5500) { // Loop to give time to check for cable connection
if (Ethernet.linkStatus() == LinkON)
break;
DIAG(F("Ethernet waiting for link (1sec) "));
delay(1000);
}
} }
/** /**

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "4.1.2" #define VERSION "4.1.3"
// 4.1.3 Bugfix: Ethernet init order
// 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level // 4.1.2 Bugfix: Ethernet shield W5100 does not report HW or link level
// 4.1.1 Bugfix: preserve turnout format // 4.1.1 Bugfix: preserve turnout format
// Bugfix: parse multiple commands in one buffer string correctly (ex: <s><Q>) // Bugfix: parse multiple commands in one buffer string correctly (ex: <s><Q>)