pio build

This commit is contained in:
Thomas Kunze 2024-08-28 21:58:51 +02:00
parent 71c1972217
commit bb8e182024
4 changed files with 396 additions and 395 deletions

View File

@ -47,26 +47,26 @@ ICACHE_RAM_ATTR void buttonEvent()
#ifdef ARDUINO_ARCH_SAMD #ifdef ARDUINO_ARCH_SAMD
// predefined global instance for TP or RF or TP/RF coupler // predefined global instance for TP or RF or TP/RF coupler
#if MASK_VERSION == 0x07B0 #if MASK_VERSION == 0x07B0
KnxFacade<SamdPlatform, Bau07B0> knx(buttonEvent); Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0 #elif MASK_VERSION == 0x27B0
KnxFacade<SamdPlatform, Bau27B0> knx(buttonEvent); Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau27B0> knx(buttonEvent);
#elif MASK_VERSION == 0x2920 #elif MASK_VERSION == 0x2920
KnxFacade<SamdPlatform, Bau2920> knx(buttonEvent); Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau2920> knx(buttonEvent);
#else #else
#error "Mask version not supported on ARDUINO_ARCH_SAMD" #error "Mask version not supported on ARDUINO_ARCH_SAMD"
#endif #endif
#elif defined(ARDUINO_ARCH_RP2040) #elif defined(ARDUINO_ARCH_RP2040)
// predefined global instance for TP or RF or IP or TP/RF coupler or TP/IP coupler // predefined global instance for TP or RF or IP or TP/RF coupler or TP/IP coupler
#if MASK_VERSION == 0x07B0 #if MASK_VERSION == 0x07B0
KnxFacade<RP2040ArduinoPlatform, Bau07B0> knx(buttonEvent); Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x27B0 #elif MASK_VERSION == 0x27B0
KnxFacade<RP2040ArduinoPlatform, Bau27B0> knx(buttonEvent); Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau27B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0 #elif MASK_VERSION == 0x57B0
KnxFacade<RP2040ArduinoPlatform, Bau57B0> knx(buttonEvent); Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x2920 #elif MASK_VERSION == 0x2920
KnxFacade<RP2040ArduinoPlatform, Bau2920> knx(buttonEvent); Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau2920> knx(buttonEvent);
#elif MASK_VERSION == 0x091A #elif MASK_VERSION == 0x091A
KnxFacade<RP2040ArduinoPlatform, Bau091A> knx(buttonEvent); Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau091A> knx(buttonEvent);
#else #else
#error "Mask version not supported on ARDUINO_ARCH_RP2040" #error "Mask version not supported on ARDUINO_ARCH_RP2040"
#endif #endif
@ -74,11 +74,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
KnxFacade<EspPlatform, Bau07B0> knx(buttonEvent); Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0 #elif MASK_VERSION == 0x57B0
KnxFacade<EspPlatform, Bau57B0> knx(buttonEvent); Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A #elif MASK_VERSION == 0x091A
KnxFacade<EspPlatform, Bau091A> knx(buttonEvent); Knx::KnxFacade<Knx::EspPlatform, 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
@ -86,18 +86,18 @@ ICACHE_RAM_ATTR void buttonEvent()
#elif defined(ARDUINO_ARCH_ESP32) #elif defined(ARDUINO_ARCH_ESP32)
// 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
KnxFacade<Esp32Platform, Bau07B0> knx(buttonEvent); Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau07B0> knx(buttonEvent);
#elif MASK_VERSION == 0x57B0 #elif MASK_VERSION == 0x57B0
KnxFacade<Esp32Platform, Bau57B0> knx(buttonEvent); Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau57B0> knx(buttonEvent);
#elif MASK_VERSION == 0x091A #elif MASK_VERSION == 0x091A
KnxFacade<Esp32Platform, Bau091A> knx(buttonEvent); Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau091A> knx(buttonEvent);
#else #else
#error "Mask version not supported on ARDUINO_ARCH_ESP32" #error "Mask version not supported on ARDUINO_ARCH_ESP32"
#endif #endif
#elif defined(ARDUINO_ARCH_STM32) #elif defined(ARDUINO_ARCH_STM32)
#if MASK_VERSION == 0x07B0 #if MASK_VERSION == 0x07B0
KnxFacade<Stm32Platform, Bau07B0> knx(buttonEvent); Knx::KnxFacade<Knx::Stm32Platform, Knx::Bau07B0> knx(buttonEvent);
#else #else
#error "Mask version not supported on ARDUINO_ARCH_STM32" #error "Mask version not supported on ARDUINO_ARCH_STM32"
#endif #endif

View File

@ -46,22 +46,23 @@
#define KNX_BUTTON -1 #define KNX_BUTTON -1
#endif #endif
namespace Knx { namespace Knx
{
#ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE #ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE
extern void buttonUp(); extern void buttonUp();
#endif #endif
typedef const uint8_t* (*RestoreCallback)(const uint8_t* buffer); typedef const uint8_t* (*RestoreCallback)(const uint8_t* buffer);
typedef uint8_t* (*SaveCallback)(uint8_t* buffer); typedef uint8_t* (*SaveCallback)(uint8_t* buffer);
typedef void (*IsrFunctionPtr)(); typedef void (*IsrFunctionPtr)();
typedef void (*ProgLedCallback)(bool on); typedef void (*ProgLedCallback)(bool on);
#ifdef KNX_ACTIVITYCALLBACK #ifdef KNX_ACTIVITYCALLBACK
typedef void (*ActivityCallback)(uint8_t info); typedef void (*ActivityCallback)(uint8_t info);
#endif #endif
template <class P, class B> class KnxFacade : private SaveRestore template <class P, class B> class KnxFacade : private SaveRestore
{ {
public: public:
KnxFacade() : _platformPtr(new P()), _bauPtr(new B(*_platformPtr)), _bau(*_bauPtr) KnxFacade() : _platformPtr(new P()), _bauPtr(new B(*_platformPtr)), _bau(*_bauPtr)
{ {
@ -453,61 +454,61 @@ template <class P, class B> class KnxFacade : private SaveRestore
else else
_progLedCallback(false); _progLedCallback(false);
} }
}; };
} }
#ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE #ifndef KNX_NO_AUTOMATIC_GLOBAL_INSTANCE
#ifdef ARDUINO_ARCH_SAMD #ifdef ARDUINO_ARCH_SAMD
// predefined global instance for TP or RF or TP/RF coupler // predefined global instance for TP or RF or TP/RF coupler
#if MASK_VERSION == 0x07B0 #if MASK_VERSION == 0x07B0
extern KnxFacade<SamdPlatform, Bau07B0> knx; extern Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau07B0> knx;
#elif MASK_VERSION == 0x27B0 #elif MASK_VERSION == 0x27B0
extern KnxFacade<SamdPlatform, Bau27B0> knx; extern Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau27B0> knx;
#elif MASK_VERSION == 0x2920 #elif MASK_VERSION == 0x2920
extern KnxFacade<SamdPlatform, Bau2920> knx; extern Knx::KnxFacade<Knx::SamdPlatform, Knx::Bau2920> knx;
#else #else
#error "Mask version not supported on ARDUINO_ARCH_SAMD" #error "Mask version not supported on ARDUINO_ARCH_SAMD"
#endif #endif
#elif defined(ARDUINO_ARCH_RP2040) #elif defined(ARDUINO_ARCH_RP2040)
// predefined global instance for TP or RF or TP/RF or TP/IP coupler // predefined global instance for TP or RF or TP/RF or TP/IP coupler
#if MASK_VERSION == 0x07B0 #if MASK_VERSION == 0x07B0
extern KnxFacade<RP2040ArduinoPlatform, Bau07B0> knx; extern Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau07B0> knx;
#elif MASK_VERSION == 0x27B0 #elif MASK_VERSION == 0x27B0
extern KnxFacade<RP2040ArduinoPlatform, Bau27B0> knx; extern Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau27B0> knx;
#elif MASK_VERSION == 0x57B0 #elif MASK_VERSION == 0x57B0
extern KnxFacade<RP2040ArduinoPlatform, Bau57B0> knx; extern Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau57B0> knx;
#elif MASK_VERSION == 0x2920 #elif MASK_VERSION == 0x2920
extern KnxFacade<RP2040ArduinoPlatform, Bau2920> knx; extern Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau2920> knx;
#elif MASK_VERSION == 0x091A #elif MASK_VERSION == 0x091A
extern KnxFacade<RP2040ArduinoPlatform, Bau091A> knx; extern Knx::KnxFacade<Knx::RP2040ArduinoPlatform, Knx::Bau091A> knx;
#else #else
#error "Mask version not supported on ARDUINO_ARCH_RP2040" #error "Mask version not supported on ARDUINO_ARCH_RP2040"
#endif #endif
#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 KnxFacade<EspPlatform, Bau07B0> knx; extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau07B0> knx;
#elif MASK_VERSION == 0x57B0 #elif MASK_VERSION == 0x57B0
extern KnxFacade<EspPlatform, Bau57B0> knx; extern Knx::KnxFacade<Knx::EspPlatform, Knx::Bau57B0> knx;
#elif MASK_VERSION == 0x091A #elif MASK_VERSION == 0x091A
extern KnxFacade<EspPlatform, Bau091A> knx; extern Knx::KnxFacade<Knx::EspPlatform, 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
#elif defined(ARDUINO_ARCH_ESP32) #elif defined(ARDUINO_ARCH_ESP32)
// 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 KnxFacade<Esp32Platform, Bau07B0> knx; extern Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau07B0> knx;
#elif MASK_VERSION == 0x57B0 #elif MASK_VERSION == 0x57B0
extern KnxFacade<Esp32Platform, Bau57B0> knx; extern Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau57B0> knx;
#elif MASK_VERSION == 0x091A #elif MASK_VERSION == 0x091A
extern KnxFacade<Esp32Platform, Bau091A> knx; extern Knx::KnxFacade<Knx::Esp32Platform, Knx::Bau091A> knx;
#else #else
#error "Mask version not supported on ARDUINO_ARCH_ESP32" #error "Mask version not supported on ARDUINO_ARCH_ESP32"
#endif #endif
#elif defined(ARDUINO_ARCH_STM32) #elif defined(ARDUINO_ARCH_STM32)
// predefined global instance for TP only // predefined global instance for TP only
#if MASK_VERSION == 0x07B0 #if MASK_VERSION == 0x07B0
extern KnxFacade<Stm32Platform, Bau07B0> knx; extern Knx::KnxFacade<Knx::Stm32Platform, Knx::Bau07B0> knx;
#else #else
#error "Mask version not supported on ARDUINO_ARCH_STM32" #error "Mask version not supported on ARDUINO_ARCH_STM32"
#endif #endif

View File

@ -35,6 +35,13 @@ For usage of KNX-IP you have to define either
#include <hardware/watchdog.h> // from Pico SDK #include <hardware/watchdog.h> // from Pico SDK
#include <pico/unique_id.h> // from Pico SDK #include <pico/unique_id.h> // from Pico SDK
#ifdef KNX_IP_LAN
extern Wiznet5500lwIP KNX_NETIF;
#elif defined(KNX_IP_WIFI)
#elif defined(KNX_IP_GENERIC)
#endif
namespace Knx namespace Knx
{ {
#ifdef USE_KNX_DMA_UART #ifdef USE_KNX_DMA_UART
@ -104,13 +111,6 @@ namespace Knx
#if KNX_FLASH_OFFSET % 4096 #if KNX_FLASH_OFFSET % 4096
#error "KNX_FLASH_OFFSET must be multiple of 4096" #error "KNX_FLASH_OFFSET must be multiple of 4096"
#endif #endif
#endif
#ifdef KNX_IP_LAN
extern Wiznet5500lwIP KNX_NETIF;
#elif defined(KNX_IP_WIFI)
#elif defined(KNX_IP_GENERIC)
#endif #endif
RP2040ArduinoPlatform::RP2040ArduinoPlatform() RP2040ArduinoPlatform::RP2040ArduinoPlatform()

View File

@ -16,6 +16,10 @@
#define KNX_SERIAL Serial1 #define KNX_SERIAL Serial1
#endif #endif
extern uint32_t __etext;
extern uint32_t __data_start__;
extern uint32_t __data_end__;
namespace Knx namespace Knx
{ {
SamdPlatform::SamdPlatform() SamdPlatform::SamdPlatform()
@ -78,10 +82,6 @@ namespace Knx
} }
#else #else
extern uint32_t __etext;
extern uint32_t __data_start__;
extern uint32_t __data_end__;
static const uint32_t pageSizes[] = {8, 16, 32, 64, 128, 256, 512, 1024}; static const uint32_t pageSizes[] = {8, 16, 32, 64, 128, 256, 512, 1024};
void SamdPlatform::init() void SamdPlatform::init()