1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-12-23 12:51:24 +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()
{
if (Ethernet.hardwareStatus() == EthernetNoHardware)
DIAG(F("Ethernet shield not detected or is a W5100"));
if (singleton!=NULL)
if (singleton!=NULL) {
DIAG(F("Prog Error!"));
if (singleton=new EthernetInterface())
return;
}
if ((singleton=new EthernetInterface()))
return;
DIAG(F("Ethernet not initialized"));
};
@ -67,6 +67,16 @@ EthernetInterface::EthernetInterface()
return;
}
#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"
#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.1 Bugfix: preserve turnout format
// Bugfix: parse multiple commands in one buffer string correctly (ex: <s><Q>)