mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-30 03:26:13 +01:00
Add loop to retry Ethernet cable connection (#173)
Implement PaulS's change to delay in a loop to give more time for sensing an Ethernet cable connection
This commit is contained in:
parent
766f88166c
commit
6eeaacdf90
|
@ -68,6 +68,16 @@ EthernetInterface::EthernetInterface()
|
||||||
DIAG(F("Ethernet shield not found"));
|
DIAG(F("Ethernet shield not found"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
if (Ethernet.linkStatus() == LinkOFF) {
|
if (Ethernet.linkStatus() == LinkOFF) {
|
||||||
DIAG(F("Ethernet cable not connected"));
|
DIAG(F("Ethernet cable not connected"));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user