mirror of
https://github.com/thelsing/knx.git
synced 2024-12-18 19:08:18 +01:00
rename esp platform to esp8266 platform and add stm32 to ci
This commit is contained in:
parent
a510042e78
commit
5ef9c8c040
@ -40,6 +40,19 @@ build_flags =
|
|||||||
-DKNX_NO_SPI=1
|
-DKNX_NO_SPI=1
|
||||||
-Wno-unknown-pragmas
|
-Wno-unknown-pragmas
|
||||||
|
|
||||||
|
;--- STM32 -----------------------------------------------
|
||||||
|
[env:adafruit_feather_f405]
|
||||||
|
platform = ststm32
|
||||||
|
board = adafruit_feather_f405
|
||||||
|
framework = arduino
|
||||||
|
lib_deps =
|
||||||
|
knx
|
||||||
|
|
||||||
|
build_flags =
|
||||||
|
-DMASK_VERSION=0x07B0
|
||||||
|
-Wno-unknown-pragmas
|
||||||
|
-DUSE_DATASECURE
|
||||||
|
|
||||||
;--- ESP8266 -----------------------------------------------
|
;--- ESP8266 -----------------------------------------------
|
||||||
[env:nodemcuv2_ip]
|
[env:nodemcuv2_ip]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
|
@ -122,8 +122,8 @@ class Samd51Platform [[class_samd51_platform.html]]
|
|||||||
Platform<|--ArduinoPlatform
|
Platform<|--ArduinoPlatform
|
||||||
ArduinoPlatform<|--Samd21Platform
|
ArduinoPlatform<|--Samd21Platform
|
||||||
ArduinoPlatform<|--Samd51Platform
|
ArduinoPlatform<|--Samd51Platform
|
||||||
class EspPlatform [[class_esp_platform.html]]
|
class Esp8266Platform [[class_esp8266_platform.html]]
|
||||||
ArduinoPlatform<|--EspPlatform
|
ArduinoPlatform<|--Esp8266Platform
|
||||||
class Esp32Platform [[class_esp32_platform.html]]
|
class Esp32Platform [[class_esp32_platform.html]]
|
||||||
ArduinoPlatform<|--Esp32Platform
|
ArduinoPlatform<|--Esp32Platform
|
||||||
class Stm32Platform [[class_stm32_platform.html]]
|
class Stm32Platform [[class_stm32_platform.html]]
|
||||||
@ -226,8 +226,8 @@ class Samd51Platform [[class_samd51_platform.html]]
|
|||||||
Platform<|--ArduinoPlatform
|
Platform<|--ArduinoPlatform
|
||||||
ArduinoPlatform<|--Samd21Platform
|
ArduinoPlatform<|--Samd21Platform
|
||||||
ArduinoPlatform<|--Samd51Platform
|
ArduinoPlatform<|--Samd51Platform
|
||||||
class EspPlatform [[class_esp_platform.html]]
|
class Esp8266Platform [[class_esp8266_platform.html]]
|
||||||
ArduinoPlatform<|--EspPlatform
|
ArduinoPlatform<|--Esp8266Platform
|
||||||
class Esp32Platform [[class_esp32_platform.html]]
|
class Esp32Platform [[class_esp32_platform.html]]
|
||||||
ArduinoPlatform<|--Esp32Platform
|
ArduinoPlatform<|--Esp32Platform
|
||||||
class Stm32Platform [[class_stm32_platform.html]]
|
class Stm32Platform [[class_stm32_platform.html]]
|
||||||
|
@ -85,11 +85,11 @@ ICACHE_RAM_ATTR void buttonEvent()
|
|||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
// predefined global instance for TP or IP or TP/IP coupler
|
// predefined global instance for TP or IP or TP/IP coupler
|
||||||
#if MASK_VERSION == 0x07B0
|
#if MASK_VERSION == 0x07B0
|
||||||
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx(buttonEvent);
|
Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau07B0> knx(buttonEvent);
|
||||||
#elif MASK_VERSION == 0x57B0
|
#elif MASK_VERSION == 0x57B0
|
||||||
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx(buttonEvent);
|
Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau57B0> knx(buttonEvent);
|
||||||
#elif MASK_VERSION == 0x091A
|
#elif MASK_VERSION == 0x091A
|
||||||
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau091A> knx(buttonEvent);
|
Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau091A> knx(buttonEvent);
|
||||||
#else
|
#else
|
||||||
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
|
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#elif defined(ARDUINO_ARCH_RP2040)
|
#elif defined(ARDUINO_ARCH_RP2040)
|
||||||
#include "platform/rp2040_arduino_platform.h"
|
#include "platform/rp2040_arduino_platform.h"
|
||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
#include "platform/esp_platform.h"
|
#include "platform/esp8266_platform.h"
|
||||||
#elif defined(ARDUINO_ARCH_ESP32)
|
#elif defined(ARDUINO_ARCH_ESP32)
|
||||||
#include "platform/esp32_platform.h"
|
#include "platform/esp32_platform.h"
|
||||||
#elif defined(ARDUINO_ARCH_STM32)
|
#elif defined(ARDUINO_ARCH_STM32)
|
||||||
@ -504,11 +504,11 @@ namespace Knx
|
|||||||
#elif defined(ARDUINO_ARCH_ESP8266)
|
#elif defined(ARDUINO_ARCH_ESP8266)
|
||||||
// predefined global instance for TP or IP or TP/IP coupler
|
// predefined global instance for TP or IP or TP/IP coupler
|
||||||
#if MASK_VERSION == 0x07B0
|
#if MASK_VERSION == 0x07B0
|
||||||
extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx;
|
extern Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau07B0> knx;
|
||||||
#elif MASK_VERSION == 0x57B0
|
#elif MASK_VERSION == 0x57B0
|
||||||
extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx;
|
extern Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau57B0> knx;
|
||||||
#elif MASK_VERSION == 0x091A
|
#elif MASK_VERSION == 0x091A
|
||||||
extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau091A> knx;
|
extern Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau091A> knx;
|
||||||
#else
|
#else
|
||||||
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
|
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifdef ARDUINO_ARCH_ESP8266
|
#ifdef ARDUINO_ARCH_ESP8266
|
||||||
#include "esp_platform.h"
|
#include "esp8266_platform.h"
|
||||||
|
|
||||||
|
|
||||||
#include <user_interface.h>
|
#include <user_interface.h>
|
||||||
@ -14,49 +14,49 @@
|
|||||||
|
|
||||||
namespace Knx
|
namespace Knx
|
||||||
{
|
{
|
||||||
EspPlatform::EspPlatform()
|
Esp8266Platform::Esp8266Platform()
|
||||||
#ifndef KNX_NO_DEFAULT_UART
|
#ifndef KNX_NO_DEFAULT_UART
|
||||||
: ArduinoPlatform(&KNX_SERIAL)
|
: ArduinoPlatform(&KNX_SERIAL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
EspPlatform::EspPlatform( HardwareSerial* s) : ArduinoPlatform(s)
|
Esp8266Platform::Esp8266Platform( HardwareSerial* s) : ArduinoPlatform(s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t EspPlatform::currentIpAddress()
|
uint32_t Esp8266Platform::currentIpAddress()
|
||||||
{
|
{
|
||||||
return WiFi.localIP();
|
return WiFi.localIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t EspPlatform::currentSubnetMask()
|
uint32_t Esp8266Platform::currentSubnetMask()
|
||||||
{
|
{
|
||||||
return WiFi.subnetMask();
|
return WiFi.subnetMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t EspPlatform::currentDefaultGateway()
|
uint32_t Esp8266Platform::currentDefaultGateway()
|
||||||
{
|
{
|
||||||
return WiFi.gatewayIP();
|
return WiFi.gatewayIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspPlatform::macAddress(uint8_t* addr)
|
void Esp8266Platform::macAddress(uint8_t* addr)
|
||||||
{
|
{
|
||||||
wifi_get_macaddr(STATION_IF, addr);
|
wifi_get_macaddr(STATION_IF, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t EspPlatform::uniqueSerialNumber()
|
uint32_t Esp8266Platform::uniqueSerialNumber()
|
||||||
{
|
{
|
||||||
return ESP.getChipId();
|
return ESP.getChipId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspPlatform::restart()
|
void Esp8266Platform::restart()
|
||||||
{
|
{
|
||||||
println("restart");
|
println("restart");
|
||||||
ESP.reset();
|
ESP.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspPlatform::setupMultiCast(uint32_t addr, uint16_t port)
|
void Esp8266Platform::setupMultiCast(uint32_t addr, uint16_t port)
|
||||||
{
|
{
|
||||||
_multicastAddr = htonl(addr);
|
_multicastAddr = htonl(addr);
|
||||||
_multicastPort = port;
|
_multicastPort = port;
|
||||||
@ -68,12 +68,12 @@ namespace Knx
|
|||||||
KNX_DEBUG_SERIAL.printf("result %d\n", result);
|
KNX_DEBUG_SERIAL.printf("result %d\n", result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspPlatform::closeMultiCast()
|
void Esp8266Platform::closeMultiCast()
|
||||||
{
|
{
|
||||||
_udp.stop();
|
_udp.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EspPlatform::sendBytesMultiCast(uint8_t* buffer, uint16_t len)
|
bool Esp8266Platform::sendBytesMultiCast(uint8_t* buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
//printHex("<- ",buffer, len);
|
//printHex("<- ",buffer, len);
|
||||||
_udp.beginPacketMulticast(_multicastAddr, _multicastPort, WiFi.localIP());
|
_udp.beginPacketMulticast(_multicastAddr, _multicastPort, WiFi.localIP());
|
||||||
@ -82,7 +82,7 @@ namespace Knx
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int EspPlatform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
|
int Esp8266Platform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
|
||||||
{
|
{
|
||||||
int len = _udp.parsePacket();
|
int len = _udp.parsePacket();
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ namespace Knx
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EspPlatform::sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len)
|
bool Esp8266Platform::sendBytesUniCast(uint32_t addr, uint16_t port, uint8_t* buffer, uint16_t len)
|
||||||
{
|
{
|
||||||
IPAddress ucastaddr(htonl(addr));
|
IPAddress ucastaddr(htonl(addr));
|
||||||
println("sendBytesUniCast endPacket fail");
|
println("sendBytesUniCast endPacket fail");
|
||||||
@ -118,7 +118,7 @@ namespace Knx
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* EspPlatform::getEepromBuffer(uint32_t size)
|
uint8_t* Esp8266Platform::getEepromBuffer(uint32_t size)
|
||||||
{
|
{
|
||||||
uint8_t* eepromptr = EEPROM.getDataPtr();
|
uint8_t* eepromptr = EEPROM.getDataPtr();
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ namespace Knx
|
|||||||
return eepromptr;
|
return eepromptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EspPlatform::commitToEeprom()
|
void Esp8266Platform::commitToEeprom()
|
||||||
{
|
{
|
||||||
EEPROM.commit();
|
EEPROM.commit();
|
||||||
}
|
}
|
@ -5,11 +5,11 @@
|
|||||||
|
|
||||||
namespace Knx
|
namespace Knx
|
||||||
{
|
{
|
||||||
class EspPlatform : public ArduinoPlatform
|
class Esp8266Platform : public ArduinoPlatform
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
EspPlatform();
|
Esp8266Platform();
|
||||||
EspPlatform(HardwareSerial* s);
|
Esp8266Platform(HardwareSerial* s);
|
||||||
|
|
||||||
// ip stuff
|
// ip stuff
|
||||||
uint32_t currentIpAddress() override;
|
uint32_t currentIpAddress() override;
|
@ -5,7 +5,7 @@
|
|||||||
#include "knx/bits.h"
|
#include "knx/bits.h"
|
||||||
|
|
||||||
#ifndef KNX_SERIAL
|
#ifndef KNX_SERIAL
|
||||||
#define KNX_SERIAL Serial2
|
#define KNX_SERIAL Serial
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Knx
|
namespace Knx
|
||||||
|
Loading…
Reference in New Issue
Block a user