From 8245208b2be908064202bf1239c4baaf605792f6 Mon Sep 17 00:00:00 2001 From: Asbelos Date: Sun, 25 Aug 2024 17:26:33 +0100 Subject: [PATCH] stm32 compiles --- EthernetInterface.cpp | 15 ++++++--------- EthernetInterface.h | 8 ++++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/EthernetInterface.cpp b/EthernetInterface.cpp index bea4162..4b83f6d 100644 --- a/EthernetInterface.cpp +++ b/EthernetInterface.cpp @@ -69,19 +69,16 @@ void EthernetInterface::setup() // STM32 VERSION // #endif /* LWIP_NETIF_HOSTNAME */ // Which seems more useful! We should propose the patch... so the following line actually works! netif_set_hostname(&gnetif, WIFI_HOSTNAME); // Should probably be passed in the contructor... - #define _MAC_ MacAddressDefault() - #else + #endif + byte mac[6]; DCCTimer::getSimulatedMacAddress(mac); - #define _MAC_ mac - #endif #ifdef IP_ADDRESS static IPAddress myIP(IP_ADDRESS); - Ethernet.begin(_MAC_,myIP); - setup(false); + Ethernet.begin(mac,myIP); #else - if (Ethernet.begin(_MAC_)==0) + if (Ethernet.begin(mac)==0) { LCD(4,F("IP: No DHCP")); return; @@ -196,14 +193,14 @@ void EthernetInterface::loop() if (!clients[socket]) { clients[socket] = client; - sockFound=true; + sockfound=true; if (Diag::ETHERNET) DIAG(F("Ethernet: New client socket %d"), socket); break; } } } - if (!sockFound) DIAG(F("new Ethernet OVERFLOW")); + if (!sockfound) DIAG(F("new Ethernet OVERFLOW")); } #else diff --git a/EthernetInterface.h b/EthernetInterface.h index 8440dde..9ea2718 100644 --- a/EthernetInterface.h +++ b/EthernetInterface.h @@ -35,6 +35,14 @@ #if defined (ARDUINO_TEENSY41) #include //TEENSY Ethernet Treiber #include +#elif defined (ARDUINO_NUCLEO_F429ZI) || defined (ARDUINO_NUCLEO_F439ZI) || defined (ARDUINO_NUCLEO_F4X9ZI) + #include +// #include "STM32lwipopts.h" + #include + #include + extern "C" struct netif gnetif; + #define STM32_ETHERNET + #define MAX_SOCK_NUM 8 #else #include "Ethernet.h" #endif