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

STM32Ethernet lib for onboard ethernet is different

This commit is contained in:
Harald Barth 2024-01-10 16:29:21 +01:00
parent 7ae6ff27f5
commit ba3d29e4b5

View File

@ -100,7 +100,7 @@ EthernetInterface::EthernetInterface()
if (Ethernet.hardwareStatus() == EthernetNoHardware) {
DIAG(F("Ethernet shield not found or W5100"));
}
#endif STM32_ETHERNET
#endif // STM32_ETHERNET
uint32_t startmilli = millis();
while ((millis() - startmilli) < 5500) { // Loop to give time to check for cable connection
@ -166,8 +166,10 @@ bool EthernetInterface::checkLink() {
DIAG(F("Ethernet cable connected"));
connected=true;
#ifdef IP_ADDRESS
#ifndef STM32_ETHERNET
Ethernet.setLocalIP(myIP); // for static IP, set it again
#endif
#endif
IPAddress ip = Ethernet.localIP(); // look what IP was obtained (dynamic or static)
server = new EthernetServer(IP_PORT); // Ethernet Server listening on default port IP_PORT
server->begin();