From ba3d29e4b565c2e02f6d87bf5e0947a9129e299a Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Wed, 10 Jan 2024 16:29:21 +0100 Subject: [PATCH] STM32Ethernet lib for onboard ethernet is different --- EthernetInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index 6c8e8fa..ad26778 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -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();