mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
remove generic ethernet support on rp2040. uses now KNX_IP_LAN or KNX_IP_WIFI
This commit is contained in:
parent
093ae425b0
commit
d0b5e84526
@ -18,9 +18,8 @@ EEPROM Emulation from arduino-pico core (max 4k) can be use by defining USE_RP20
|
||||
A RAM-buffered Flash can be use by defining USE_RP2040_LARGE_EEPROM_EMULATION
|
||||
|
||||
For usage of KNX-IP you have to define either
|
||||
- KNX_IP_W5500 (use the arduino-pico core's w5500 lwip stack)
|
||||
- KNX_IP_LAN (use the arduino-pico core's w5500 lwip stack)
|
||||
- KNX_IP_WIFI (use the arduino-pico core's PiPicoW lwip stack)
|
||||
- KNX_IP_GENERIC (use the Ethernet_Generic stack)
|
||||
|
||||
----------------------------------------------------*/
|
||||
|
||||
@ -106,7 +105,7 @@ void __time_critical_func(uartDmaRestart)()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef KNX_IP_W5500
|
||||
#ifdef KNX_IP_LAN
|
||||
extern Wiznet5500lwIP KNX_NETIF;
|
||||
#elif defined(KNX_IP_WIFI)
|
||||
#elif defined(KNX_IP_GENERIC)
|
||||
@ -462,13 +461,11 @@ uint32_t RP2040ArduinoPlatform::currentDefaultGateway()
|
||||
}
|
||||
void RP2040ArduinoPlatform::macAddress(uint8_t* addr)
|
||||
{
|
||||
#if defined(KNX_IP_W5500)
|
||||
#if defined(KNX_IP_LAN)
|
||||
addr = KNX_NETIF.getNetIf()->hwaddr;
|
||||
#elif defined(KNX_IP_WIFI)
|
||||
#else
|
||||
uint8_t macaddr[6] = {0, 0, 0, 0, 0, 0};
|
||||
addr = KNX_NETIF.macAddress(macaddr);
|
||||
#elif defined(KNX_IP_GENERIC)
|
||||
KNX_NETIF.MACAddress(addr);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -22,40 +22,18 @@
|
||||
#define KNX_SERIAL Serial1
|
||||
#endif
|
||||
|
||||
#ifdef KNX_IP_W5500
|
||||
#if ARDUINO_PICO_MAJOR * 10000 + ARDUINO_PICO_MINOR * 100 + ARDUINO_PICO_REVISION < 30600
|
||||
#pragma error "arduino-pico >= 3.6.0 needed"
|
||||
#ifdef KNX_IP_LAN
|
||||
#if ARDUINO_PICO_MAJOR * 10000 + ARDUINO_PICO_MINOR * 100 + ARDUINO_PICO_REVISION < 30700
|
||||
#pragma error "arduino-pico >= 3.7.0 needed"
|
||||
#endif
|
||||
#define KNX_NETIF Eth
|
||||
|
||||
#include "SPI.h"
|
||||
#include <W5500lwIP.h>
|
||||
|
||||
#elif defined(KNX_IP_WIFI)
|
||||
|
||||
#define KNX_NETIF WiFi
|
||||
#else
|
||||
#include <WiFi.h>
|
||||
|
||||
#elif defined(KNX_IP_GENERIC)
|
||||
|
||||
|
||||
#include <SPI.h>
|
||||
|
||||
#ifndef DEBUG_ETHERNET_GENERIC_PORT
|
||||
#define DEBUG_ETHERNET_GENERIC_PORT Serial
|
||||
#endif
|
||||
|
||||
#ifndef _ETG_LOGLEVEL_
|
||||
#define _ETG_LOGLEVEL_ 1
|
||||
#endif
|
||||
|
||||
|
||||
#define ETHERNET_USE_RPIPICO true
|
||||
#include <Ethernet_Generic.hpp> // https://github.com/khoih-prog/Ethernet_Generic
|
||||
|
||||
|
||||
#define KNX_NETIF Ethernet
|
||||
|
||||
#define KNX_NETIF WiFi
|
||||
#endif
|
||||
|
||||
#if USE_KNX_DMA_UART == 1
|
||||
@ -146,15 +124,8 @@ public:
|
||||
// unicast
|
||||
bool sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len) override;
|
||||
|
||||
#if defined(KNX_IP_W5500) || defined(KNX_IP_WIFI)
|
||||
#define UDP_UNICAST _udp
|
||||
protected: WiFiUDP _udp;
|
||||
#elif defined(KNX_IP_GENERIC)
|
||||
#define UDP_UNICAST _udp_uni
|
||||
protected: bool _unicast_socket_setup = false;
|
||||
protected: EthernetUDP _udp;
|
||||
protected: EthernetUDP UDP_UNICAST;
|
||||
#endif
|
||||
protected: IPAddress mcastaddr;
|
||||
protected: uint16_t _port;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user