[SX128x] Reworked macro configuration system

This commit is contained in:
jgromes 2023-11-27 21:15:07 +01:00
parent 34c861cfbe
commit 827aac5938
8 changed files with 17 additions and 17 deletions

View file

@ -1,6 +1,6 @@
#include "SX1280.h" #include "SX1280.h"
#include <string.h> #include <string.h>
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
SX1280::SX1280(Module* mod) : SX1281(mod) { SX1280::SX1280(Module* mod) : SX1281(mod) {

View file

@ -3,7 +3,7 @@
#include "../../TypeDef.h" #include "../../TypeDef.h"
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
#include "../../Module.h" #include "../../Module.h"
#include "SX128x.h" #include "SX128x.h"
@ -45,7 +45,7 @@ class SX1280: public SX1281 {
*/ */
float getRangingResult(); float getRangingResult();
#if !defined(RADIOLIB_GODMODE) #if !RADIOLIB_GODMODE
private: private:
#endif #endif

View file

@ -1,5 +1,5 @@
#include "SX1281.h" #include "SX1281.h"
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
SX1281::SX1281(Module* mod) : SX128x(mod) { SX1281::SX1281(Module* mod) : SX128x(mod) {

View file

@ -3,7 +3,7 @@
#include "../../TypeDef.h" #include "../../TypeDef.h"
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
#include "../../Module.h" #include "../../Module.h"
#include "SX128x.h" #include "SX128x.h"
@ -20,7 +20,7 @@ class SX1281: public SX128x {
*/ */
SX1281(Module* mod); SX1281(Module* mod);
#if !defined(RADIOLIB_GODMODE) #if !RADIOLIB_GODMODE
private: private:
#endif #endif

View file

@ -1,5 +1,5 @@
#include "SX1282.h" #include "SX1282.h"
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
/// \todo implement advanced ranging /// \todo implement advanced ranging
SX1282::SX1282(Module* mod) : SX1280(mod) { SX1282::SX1282(Module* mod) : SX1280(mod) {

View file

@ -3,7 +3,7 @@
#include "../../TypeDef.h" #include "../../TypeDef.h"
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
#include "../../Module.h" #include "../../Module.h"
#include "SX128x.h" #include "SX128x.h"
@ -21,7 +21,7 @@ class SX1282: public SX1280 {
*/ */
SX1282(Module* mod); SX1282(Module* mod);
#if !defined(RADIOLIB_GODMODE) #if !RADIOLIB_GODMODE
private: private:
#endif #endif

View file

@ -1,6 +1,6 @@
#include "SX128x.h" #include "SX128x.h"
#include <math.h> #include <math.h>
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
SX128x::SX128x(Module* mod) : PhysicalLayer(RADIOLIB_SX128X_FREQUENCY_STEP_SIZE, RADIOLIB_SX128X_MAX_PACKET_LENGTH) { SX128x::SX128x(Module* mod) : PhysicalLayer(RADIOLIB_SX128X_FREQUENCY_STEP_SIZE, RADIOLIB_SX128X_MAX_PACKET_LENGTH) {
this->mod = mod; 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)); 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)) { void SX128x::setDirectAction(void (*func)(void)) {
// SX128x is unable to perform direct mode reception // SX128x is unable to perform direct mode reception
// this method is implemented only for PhysicalLayer compatibility // this method is implemented only for PhysicalLayer compatibility

View file

@ -3,7 +3,7 @@
#include "../../TypeDef.h" #include "../../TypeDef.h"
#if !defined(RADIOLIB_EXCLUDE_SX128X) #if !RADIOLIB_EXCLUDE_SX128X
#include "../../Module.h" #include "../../Module.h"
@ -765,7 +765,7 @@ class SX128x: public PhysicalLayer {
*/ */
int16_t invertIQ(bool enable); int16_t invertIQ(bool enable);
#if !defined(RADIOLIB_EXCLUDE_DIRECT_RECEIVE) #if !RADIOLIB_EXCLUDE_DIRECT_RECEIVE
/*! /*!
\brief Dummy method, to ensure PhysicalLayer compatibility. \brief Dummy method, to ensure PhysicalLayer compatibility.
\param func Ignored. \param func Ignored.
@ -779,12 +779,12 @@ class SX128x: public PhysicalLayer {
void readBit(uint32_t pin); void readBit(uint32_t pin);
#endif #endif
#if !defined(RADIOLIB_GODMODE) && !defined(RADIOLIB_LOW_LEVEL) #if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
protected: protected:
#endif #endif
Module* mod; Module* mod;
#if !defined(RADIOLIB_GODMODE) #if !RADIOLIB_GODMODE
protected: protected:
#endif #endif
@ -817,14 +817,14 @@ class SX128x: public PhysicalLayer {
int16_t setHeaderType(uint8_t hdrType, size_t len = 0xFF); 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: private:
#endif #endif
// common low-level SPI interface // common low-level SPI interface
static int16_t SPIparseStatus(uint8_t in); static int16_t SPIparseStatus(uint8_t in);
#if !defined(RADIOLIB_GODMODE) #if !RADIOLIB_GODMODE
private: private:
#endif #endif
// common parameters // common parameters