diff --git a/src/modules/SX127x/SX1272.cpp b/src/modules/SX127x/SX1272.cpp index 28fedba3..b37cf75e 100644 --- a/src/modules/SX127x/SX1272.cpp +++ b/src/modules/SX127x/SX1272.cpp @@ -1,4 +1,5 @@ #include "SX1272.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX1272::SX1272(Module* mod) : SX127x(mod) { @@ -417,3 +418,5 @@ int16_t SX1272::configFSK() { return(state); } + +#endif diff --git a/src/modules/SX127x/SX1272.h b/src/modules/SX127x/SX1272.h index a0f64541..547f2905 100644 --- a/src/modules/SX127x/SX1272.h +++ b/src/modules/SX127x/SX1272.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX1272_H +#if !defined(_RADIOLIB_SX1272_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX1272_H #include "../../TypeDef.h" @@ -155,7 +155,7 @@ class SX1272: public SX127x { \returns \ref status_codes */ int16_t beginFSK(float freq = 915.0, float br = 48.0, float rxBw = 125.0, float freqDev = 50.0, int8_t power = 13, uint8_t currentLimit = 100, uint16_t preambleLength = 16, bool enableOOK = false); - + /*! \brief Reset method. Will reset the chip to the default state using RST pin. */ diff --git a/src/modules/SX127x/SX1273.cpp b/src/modules/SX127x/SX1273.cpp index ee0a48fc..b45ca0e5 100644 --- a/src/modules/SX127x/SX1273.cpp +++ b/src/modules/SX127x/SX1273.cpp @@ -1,4 +1,5 @@ #include "SX1273.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX1273::SX1273(Module* mod) : SX1272(mod) { @@ -68,3 +69,5 @@ int16_t SX1273::setSpreadingFactor(uint8_t sf) { return(state); } + +#endif diff --git a/src/modules/SX127x/SX1273.h b/src/modules/SX127x/SX1273.h index 52ffafd1..ac7fcd98 100644 --- a/src/modules/SX127x/SX1273.h +++ b/src/modules/SX127x/SX1273.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX1273_H +#if !defined(_RADIOLIB_SX1273_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX1273_H #include "../../TypeDef.h" diff --git a/src/modules/SX127x/SX1276.cpp b/src/modules/SX127x/SX1276.cpp index 2fecd63a..66510443 100644 --- a/src/modules/SX127x/SX1276.cpp +++ b/src/modules/SX127x/SX1276.cpp @@ -1,4 +1,5 @@ #include "SX1276.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX1276::SX1276(Module* mod) : SX1278(mod) { @@ -103,3 +104,5 @@ int16_t SX1276::setFrequency(float freq) { // set frequency return(SX127x::setFrequencyRaw(freq)); } + +#endif diff --git a/src/modules/SX127x/SX1276.h b/src/modules/SX127x/SX1276.h index 8a320ec8..55861cc3 100644 --- a/src/modules/SX127x/SX1276.h +++ b/src/modules/SX127x/SX1276.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX1276_H +#if !defined(_RADIOLIB_SX1276_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX1276_H #include "../../TypeDef.h" diff --git a/src/modules/SX127x/SX1277.cpp b/src/modules/SX127x/SX1277.cpp index 715d8853..fe187055 100644 --- a/src/modules/SX127x/SX1277.cpp +++ b/src/modules/SX127x/SX1277.cpp @@ -1,4 +1,5 @@ #include "SX1277.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX1277::SX1277(Module* mod) : SX1278(mod) { @@ -133,3 +134,5 @@ int16_t SX1277::setSpreadingFactor(uint8_t sf) { return(state); } + +#endif diff --git a/src/modules/SX127x/SX1277.h b/src/modules/SX127x/SX1277.h index cee312a3..afbfdc1f 100644 --- a/src/modules/SX127x/SX1277.h +++ b/src/modules/SX127x/SX1277.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX1277_H +#if !defined(_RADIOLIB_SX1277_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX1277_H #include "../../TypeDef.h" diff --git a/src/modules/SX127x/SX1278.cpp b/src/modules/SX127x/SX1278.cpp index af3fc0b3..698634f8 100644 --- a/src/modules/SX127x/SX1278.cpp +++ b/src/modules/SX127x/SX1278.cpp @@ -1,4 +1,5 @@ #include "SX1278.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX1278::SX1278(Module* mod) : SX127x(mod) { @@ -495,3 +496,5 @@ int16_t SX1278::configFSK() { return(state); } + +#endif diff --git a/src/modules/SX127x/SX1278.h b/src/modules/SX127x/SX1278.h index 77318e15..e2c5220a 100644 --- a/src/modules/SX127x/SX1278.h +++ b/src/modules/SX127x/SX1278.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX1278_H +#if !defined(_RADIOLIB_SX1278_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX1278_H #include "../../TypeDef.h" @@ -169,7 +169,7 @@ class SX1278: public SX127x { \brief Reset method. Will reset the chip to the default state using RST pin. */ void reset(); - + // configuration methods /*! diff --git a/src/modules/SX127x/SX1279.cpp b/src/modules/SX127x/SX1279.cpp index 1b45c9b7..9d5562e5 100644 --- a/src/modules/SX127x/SX1279.cpp +++ b/src/modules/SX127x/SX1279.cpp @@ -1,4 +1,5 @@ #include "SX1279.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX1279::SX1279(Module* mod) : SX1278(mod) { @@ -40,3 +41,5 @@ int16_t SX1279::setFrequency(float freq) { // set frequency return(SX127x::setFrequencyRaw(freq)); } + +#endif diff --git a/src/modules/SX127x/SX1279.h b/src/modules/SX127x/SX1279.h index f0953ecd..9908b3eb 100644 --- a/src/modules/SX127x/SX1279.h +++ b/src/modules/SX127x/SX1279.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX1279_H +#if !defined(_RADIOLIB_SX1279_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX1279_H #include "../../TypeDef.h" diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp index 45fe5f01..c3d2dd7e 100644 --- a/src/modules/SX127x/SX127x.cpp +++ b/src/modules/SX127x/SX127x.cpp @@ -1,4 +1,5 @@ #include "SX127x.h" +#if !defined(RADIOLIB_EXCLUDE_SX127X) SX127x::SX127x(Module* mod) : PhysicalLayer(SX127X_FREQUENCY_STEP_SIZE, SX127X_MAX_PACKET_LENGTH) { _mod = mod; @@ -1134,27 +1135,4 @@ void SX127x::clearFIFO(size_t count) { } } -#ifdef RADIOLIB_DEBUG -void SX127x::regDump() { - RADIOLIB_DEBUG_PRINTLN(); - RADIOLIB_DEBUG_PRINTLN(F("ADDR\tVALUE")); - for(uint16_t addr = 0x01; addr <= 0x70; addr++) { - if(addr <= 0x0F) { - RADIOLIB_DEBUG_PRINT(F("0x0")); - } else { - RADIOLIB_DEBUG_PRINT(F("0x")); - } - RADIOLIB_DEBUG_PRINT(addr, HEX); - RADIOLIB_DEBUG_PRINT('\t'); - uint8_t val = _mod->SPIreadRegister(addr); - if(val <= 0x0F) { - RADIOLIB_DEBUG_PRINT(F("0x0")); - } else { - RADIOLIB_DEBUG_PRINT(F("0x")); - } - RADIOLIB_DEBUG_PRINTLN(val, HEX); - - delay(50); - } -} #endif diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h index 7f075e9b..0023e4d8 100644 --- a/src/modules/SX127x/SX127x.h +++ b/src/modules/SX127x/SX127x.h @@ -1,4 +1,4 @@ -#ifndef _RADIOLIB_SX127X_H +#if !defined(_RADIOLIB_SX127X_H) && !defined(RADIOLIB_EXCLUDE_SX127X) #define _RADIOLIB_SX127X_H #include "../../TypeDef.h" @@ -931,10 +931,6 @@ class SX127x: public PhysicalLayer { */ void setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn); - #ifdef RADIOLIB_DEBUG - void regDump(); - #endif - #ifndef RADIOLIB_GODMODE protected: #endif