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:
parent
4ed2ee9adc
commit
8245208b2b
|
@ -69,19 +69,16 @@ void EthernetInterface::setup() // STM32 VERSION
|
||||||
// #endif /* LWIP_NETIF_HOSTNAME */
|
// #endif /* LWIP_NETIF_HOSTNAME */
|
||||||
// Which seems more useful! We should propose the patch... so the following line actually works!
|
// 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...
|
netif_set_hostname(&gnetif, WIFI_HOSTNAME); // Should probably be passed in the contructor...
|
||||||
#define _MAC_ MacAddressDefault()
|
#endif
|
||||||
#else
|
|
||||||
byte mac[6];
|
byte mac[6];
|
||||||
DCCTimer::getSimulatedMacAddress(mac);
|
DCCTimer::getSimulatedMacAddress(mac);
|
||||||
#define _MAC_ mac
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef IP_ADDRESS
|
#ifdef IP_ADDRESS
|
||||||
static IPAddress myIP(IP_ADDRESS);
|
static IPAddress myIP(IP_ADDRESS);
|
||||||
Ethernet.begin(_MAC_,myIP);
|
Ethernet.begin(mac,myIP);
|
||||||
setup(false);
|
|
||||||
#else
|
#else
|
||||||
if (Ethernet.begin(_MAC_)==0)
|
if (Ethernet.begin(mac)==0)
|
||||||
{
|
{
|
||||||
LCD(4,F("IP: No DHCP"));
|
LCD(4,F("IP: No DHCP"));
|
||||||
return;
|
return;
|
||||||
|
@ -196,14 +193,14 @@ void EthernetInterface::loop()
|
||||||
if (!clients[socket])
|
if (!clients[socket])
|
||||||
{
|
{
|
||||||
clients[socket] = client;
|
clients[socket] = client;
|
||||||
sockFound=true;
|
sockfound=true;
|
||||||
if (Diag::ETHERNET)
|
if (Diag::ETHERNET)
|
||||||
DIAG(F("Ethernet: New client socket %d"), socket);
|
DIAG(F("Ethernet: New client socket %d"), socket);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sockFound) DIAG(F("new Ethernet OVERFLOW"));
|
if (!sockfound) DIAG(F("new Ethernet OVERFLOW"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -35,6 +35,14 @@
|
||||||
#if defined (ARDUINO_TEENSY41)
|
#if defined (ARDUINO_TEENSY41)
|
||||||
#include <NativeEthernet.h> //TEENSY Ethernet Treiber
|
#include <NativeEthernet.h> //TEENSY Ethernet Treiber
|
||||||
#include <NativeEthernetUdp.h>
|
#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
|
#else
|
||||||
#include "Ethernet.h"
|
#include "Ethernet.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user