1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-16 22:19:14 +01:00

Fix for W5100 ethernet shield which does not report as the W5200 or W5500

This commit is contained in:
Harald Barth 2022-10-28 13:24:12 +02:00
parent 4bfd4b1a12
commit df6c511d1d
2 changed files with 10 additions and 9 deletions

View File

@ -36,13 +36,13 @@ EthernetInterface * EthernetInterface::singleton=NULL;
*/ */
void EthernetInterface::setup() void EthernetInterface::setup()
{ {
if (Ethernet.hardwareStatus() == EthernetNoHardware) { if (Ethernet.hardwareStatus() == EthernetNoHardware)
if (singleton!=NULL) DIAG(F("Ethernet shield not detected or is a W5100"));
DIAG(F("Prog Error!")); if (singleton!=NULL)
} else { DIAG(F("Prog Error!"));
singleton=new EthernetInterface(); if (singleton=new EthernetInterface())
} return;
DIAG(F("Ethernet shield %sfound"), singleton==NULL ? "not " : ""); DIAG(F("Ethernet not initialized"));
}; };
@ -111,7 +111,7 @@ void EthernetInterface::loop() {
* @return true when cable is connected, false otherwise * @return true when cable is connected, false otherwise
*/ */
bool EthernetInterface::checkLink() { bool EthernetInterface::checkLink() {
if (Ethernet.linkStatus() == LinkON) { if (Ethernet.linkStatus() != LinkOFF) { // check for not linkOFF instead of linkON as the W5100 does return LinkUnknown
//if we are not connected yet, setup a new server //if we are not connected yet, setup a new server
if(!connected) { if(!connected) {
DIAG(F("Ethernet cable connected")); DIAG(F("Ethernet cable connected"));

View File

@ -3,7 +3,8 @@
#include "StringFormatter.h" #include "StringFormatter.h"
#define VERSION "4.1.1" #define VERSION "4.1.2"
// 4.2.1 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>)
// Bugfix: </> command signal status of EX-RAIL tasks or threads // Bugfix: </> command signal status of EX-RAIL tasks or threads