rename esp platform to esp8266 platform and add stm32 to ci

This commit is contained in:
Thomas Kunze 2024-09-13 18:06:52 +02:00
parent a510042e78
commit 5ef9c8c040
7 changed files with 44 additions and 31 deletions

View File

@ -40,6 +40,19 @@ build_flags =
-DKNX_NO_SPI=1
-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 -----------------------------------------------
[env:nodemcuv2_ip]
platform = espressif8266

View File

@ -122,8 +122,8 @@ class Samd51Platform [[class_samd51_platform.html]]
Platform<|--ArduinoPlatform
ArduinoPlatform<|--Samd21Platform
ArduinoPlatform<|--Samd51Platform
class EspPlatform [[class_esp_platform.html]]
ArduinoPlatform<|--EspPlatform
class Esp8266Platform [[class_esp8266_platform.html]]
ArduinoPlatform<|--Esp8266Platform
class Esp32Platform [[class_esp32_platform.html]]
ArduinoPlatform<|--Esp32Platform
class Stm32Platform [[class_stm32_platform.html]]
@ -226,8 +226,8 @@ class Samd51Platform [[class_samd51_platform.html]]
Platform<|--ArduinoPlatform
ArduinoPlatform<|--Samd21Platform
ArduinoPlatform<|--Samd51Platform
class EspPlatform [[class_esp_platform.html]]
ArduinoPlatform<|--EspPlatform
class Esp8266Platform [[class_esp8266_platform.html]]
ArduinoPlatform<|--Esp8266Platform
class Esp32Platform [[class_esp32_platform.html]]
ArduinoPlatform<|--Esp32Platform
class Stm32Platform [[class_stm32_platform.html]]

View File

@ -85,11 +85,11 @@ ICACHE_RAM_ATTR void buttonEvent()
#elif defined(ARDUINO_ARCH_ESP8266)
// predefined global instance for TP or IP or TP/IP coupler
#if MASK_VERSION == 0x07B0
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx(buttonEvent);
Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx(buttonEvent);
Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A
Knx::KnxFacade<Knx::EspPlatform, Knx::Bau091A> knx(buttonEvent);
Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau091A> knx(buttonEvent);
#else
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
#endif

View File

@ -21,7 +21,7 @@
#elif defined(ARDUINO_ARCH_RP2040)
#include "platform/rp2040_arduino_platform.h"
#elif defined(ARDUINO_ARCH_ESP8266)
#include "platform/esp_platform.h"
#include "platform/esp8266_platform.h"
#elif defined(ARDUINO_ARCH_ESP32)
#include "platform/esp32_platform.h"
#elif defined(ARDUINO_ARCH_STM32)
@ -504,11 +504,11 @@ namespace Knx
#elif defined(ARDUINO_ARCH_ESP8266)
// predefined global instance for TP or IP or TP/IP coupler
#if MASK_VERSION == 0x07B0
extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx;
extern Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau07B0> knx;
#elif MASK_VERSION == 0x57B0
extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx;
extern Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau57B0> knx;
#elif MASK_VERSION == 0x091A
extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau091A> knx;
extern Knx::KnxFacade<Knx::Esp8266Platform, Knx::Bau091A> knx;
#else
#error "Mask version not supported on ARDUINO_ARCH_ESP8266"
#endif

View File

@ -1,5 +1,5 @@
#ifdef ARDUINO_ARCH_ESP8266
#include "esp_platform.h"
#include "esp8266_platform.h"
#include <user_interface.h>
@ -14,49 +14,49 @@
namespace Knx
{
EspPlatform::EspPlatform()
Esp8266Platform::Esp8266Platform()
#ifndef KNX_NO_DEFAULT_UART
: ArduinoPlatform(&KNX_SERIAL)
#endif
{
}
EspPlatform::EspPlatform( HardwareSerial* s) : ArduinoPlatform(s)
Esp8266Platform::Esp8266Platform( HardwareSerial* s) : ArduinoPlatform(s)
{
}
uint32_t EspPlatform::currentIpAddress()
uint32_t Esp8266Platform::currentIpAddress()
{
return WiFi.localIP();
}
uint32_t EspPlatform::currentSubnetMask()
uint32_t Esp8266Platform::currentSubnetMask()
{
return WiFi.subnetMask();
}
uint32_t EspPlatform::currentDefaultGateway()
uint32_t Esp8266Platform::currentDefaultGateway()
{
return WiFi.gatewayIP();
}
void EspPlatform::macAddress(uint8_t* addr)
void Esp8266Platform::macAddress(uint8_t* addr)
{
wifi_get_macaddr(STATION_IF, addr);
}
uint32_t EspPlatform::uniqueSerialNumber()
uint32_t Esp8266Platform::uniqueSerialNumber()
{
return ESP.getChipId();
}
void EspPlatform::restart()
void Esp8266Platform::restart()
{
println("restart");
ESP.reset();
}
void EspPlatform::setupMultiCast(uint32_t addr, uint16_t port)
void Esp8266Platform::setupMultiCast(uint32_t addr, uint16_t port)
{
_multicastAddr = htonl(addr);
_multicastPort = port;
@ -68,12 +68,12 @@ namespace Knx
KNX_DEBUG_SERIAL.printf("result %d\n", result);
}
void EspPlatform::closeMultiCast()
void Esp8266Platform::closeMultiCast()
{
_udp.stop();
}
bool EspPlatform::sendBytesMultiCast(uint8_t* buffer, uint16_t len)
bool Esp8266Platform::sendBytesMultiCast(uint8_t* buffer, uint16_t len)
{
//printHex("<- ",buffer, len);
_udp.beginPacketMulticast(_multicastAddr, _multicastPort, WiFi.localIP());
@ -82,7 +82,7 @@ namespace Knx
return true;
}
int EspPlatform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
int Esp8266Platform::readBytesMultiCast(uint8_t* buffer, uint16_t maxLen)
{
int len = _udp.parsePacket();
@ -100,7 +100,7 @@ namespace Knx
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));
println("sendBytesUniCast endPacket fail");
@ -118,7 +118,7 @@ namespace Knx
return true;
}
uint8_t* EspPlatform::getEepromBuffer(uint32_t size)
uint8_t* Esp8266Platform::getEepromBuffer(uint32_t size)
{
uint8_t* eepromptr = EEPROM.getDataPtr();
@ -131,7 +131,7 @@ namespace Knx
return eepromptr;
}
void EspPlatform::commitToEeprom()
void Esp8266Platform::commitToEeprom()
{
EEPROM.commit();
}

View File

@ -5,11 +5,11 @@
namespace Knx
{
class EspPlatform : public ArduinoPlatform
class Esp8266Platform : public ArduinoPlatform
{
public:
EspPlatform();
EspPlatform(HardwareSerial* s);
Esp8266Platform();
Esp8266Platform(HardwareSerial* s);
// ip stuff
uint32_t currentIpAddress() override;

View File

@ -5,7 +5,7 @@
#include "knx/bits.h"
#ifndef KNX_SERIAL
#define KNX_SERIAL Serial2
#define KNX_SERIAL Serial
#endif
namespace Knx