1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

stm32 compiles

This commit is contained in:
Asbelos 2024-08-25 17:26:33 +01:00
parent 4ed2ee9adc
commit 8245208b2b
2 changed files with 14 additions and 9 deletions

View File

@ -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

View File

@ -35,6 +35,14 @@
#if defined (ARDUINO_TEENSY41)
#include <NativeEthernet.h> //TEENSY Ethernet Treiber
#include <NativeEthernetUdp.h>
#elif defined (ARDUINO_NUCLEO_F429ZI) || defined (ARDUINO_NUCLEO_F439ZI) || defined (ARDUINO_NUCLEO_F4X9ZI)
#include <LwIP.h>
// #include "STM32lwipopts.h"
#include <STM32Ethernet.h>
#include <lwip/netif.h>
extern "C" struct netif gnetif;
#define STM32_ETHERNET
#define MAX_SOCK_NUM 8
#else
#include "Ethernet.h"
#endif