From 827aac593807cc728b0a1b3bc20e8df3e7f5eb22 Mon Sep 17 00:00:00 2001 From: jgromes Date: Mon, 27 Nov 2023 21:15:07 +0100 Subject: [PATCH] [SX128x] Reworked macro configuration system --- src/modules/SX128x/SX1280.cpp | 2 +- src/modules/SX128x/SX1280.h | 4 ++-- src/modules/SX128x/SX1281.cpp | 2 +- src/modules/SX128x/SX1281.h | 4 ++-- src/modules/SX128x/SX1282.cpp | 2 +- src/modules/SX128x/SX1282.h | 4 ++-- src/modules/SX128x/SX128x.cpp | 4 ++-- src/modules/SX128x/SX128x.h | 12 ++++++------ 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/modules/SX128x/SX1280.cpp b/src/modules/SX128x/SX1280.cpp index b53c1a62..cc4c9798 100644 --- a/src/modules/SX128x/SX1280.cpp +++ b/src/modules/SX128x/SX1280.cpp @@ -1,6 +1,6 @@ #include "SX1280.h" #include -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X SX1280::SX1280(Module* mod) : SX1281(mod) { diff --git a/src/modules/SX128x/SX1280.h b/src/modules/SX128x/SX1280.h index 51bb7c0b..c798f044 100644 --- a/src/modules/SX128x/SX1280.h +++ b/src/modules/SX128x/SX1280.h @@ -3,7 +3,7 @@ #include "../../TypeDef.h" -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X #include "../../Module.h" #include "SX128x.h" @@ -45,7 +45,7 @@ class SX1280: public SX1281 { */ float getRangingResult(); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE private: #endif diff --git a/src/modules/SX128x/SX1281.cpp b/src/modules/SX128x/SX1281.cpp index c6b2b5eb..71e7476e 100644 --- a/src/modules/SX128x/SX1281.cpp +++ b/src/modules/SX128x/SX1281.cpp @@ -1,5 +1,5 @@ #include "SX1281.h" -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X SX1281::SX1281(Module* mod) : SX128x(mod) { diff --git a/src/modules/SX128x/SX1281.h b/src/modules/SX128x/SX1281.h index 04a9eb19..3a41b60a 100644 --- a/src/modules/SX128x/SX1281.h +++ b/src/modules/SX128x/SX1281.h @@ -3,7 +3,7 @@ #include "../../TypeDef.h" -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X #include "../../Module.h" #include "SX128x.h" @@ -20,7 +20,7 @@ class SX1281: public SX128x { */ SX1281(Module* mod); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE private: #endif diff --git a/src/modules/SX128x/SX1282.cpp b/src/modules/SX128x/SX1282.cpp index 33deee97..d58ba3d3 100644 --- a/src/modules/SX128x/SX1282.cpp +++ b/src/modules/SX128x/SX1282.cpp @@ -1,5 +1,5 @@ #include "SX1282.h" -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X /// \todo implement advanced ranging SX1282::SX1282(Module* mod) : SX1280(mod) { diff --git a/src/modules/SX128x/SX1282.h b/src/modules/SX128x/SX1282.h index 864e463d..091bf133 100644 --- a/src/modules/SX128x/SX1282.h +++ b/src/modules/SX128x/SX1282.h @@ -3,7 +3,7 @@ #include "../../TypeDef.h" -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X #include "../../Module.h" #include "SX128x.h" @@ -21,7 +21,7 @@ class SX1282: public SX1280 { */ SX1282(Module* mod); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE private: #endif diff --git a/src/modules/SX128x/SX128x.cpp b/src/modules/SX128x/SX128x.cpp index 3e26382e..6f14b536 100644 --- a/src/modules/SX128x/SX128x.cpp +++ b/src/modules/SX128x/SX128x.cpp @@ -1,6 +1,6 @@ #include "SX128x.h" #include -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X SX128x::SX128x(Module* mod) : PhysicalLayer(RADIOLIB_SX128X_FREQUENCY_STEP_SIZE, RADIOLIB_SX128X_MAX_PACKET_LENGTH) { this->mod = mod; @@ -1333,7 +1333,7 @@ int16_t SX128x::invertIQ(bool enable) { return(setPacketParamsLoRa(this->preambleLengthLoRa, this->headerType, this->payloadLen, this->crcLoRa, this->invertIQEnabled)); } -#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) +#if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE void SX128x::setDirectAction(void (*func)(void)) { // SX128x is unable to perform direct mode reception // this method is implemented only for PhysicalLayer compatibility diff --git a/src/modules/SX128x/SX128x.h b/src/modules/SX128x/SX128x.h index 1aa69115..b2e63bbd 100644 --- a/src/modules/SX128x/SX128x.h +++ b/src/modules/SX128x/SX128x.h @@ -3,7 +3,7 @@ #include "../../TypeDef.h" -#if !defined(RADIOLIB_EXCLUDE_SX128X) +#if !RADIOLIB_EXCLUDE_SX128X #include "../../Module.h" @@ -765,7 +765,7 @@ class SX128x: public PhysicalLayer { */ int16_t invertIQ(bool enable); - #if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) + #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE /*! \brief Dummy method, to ensure PhysicalLayer compatibility. \param func Ignored. @@ -779,12 +779,12 @@ class SX128x: public PhysicalLayer { void readBit(uint32_t pin); #endif -#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) +#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL protected: #endif Module* mod; -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE protected: #endif @@ -817,14 +817,14 @@ class SX128x: public PhysicalLayer { int16_t setHeaderType(uint8_t hdrType, size_t len = 0xFF); -#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) +#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL private: #endif // common low-level SPI interface static int16_t SPIparseStatus(uint8_t in); -#if !defined(RADIOLIB_GODMODE) +#if !RADIOLIB_GODMODE private: #endif // common parameters