[SX127x] Reworked driver exclusion

This commit is contained in:
jgromes 2020-06-30 10:43:56 +02:00
parent 58ddfb8b51
commit 3dd3a471e5
14 changed files with 28 additions and 36 deletions

View file

@ -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

View file

@ -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.
*/

View file

@ -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

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_SX1273_H
#if !defined(_RADIOLIB_SX1273_H) && !defined(RADIOLIB_EXCLUDE_SX127X)
#define _RADIOLIB_SX1273_H
#include "../../TypeDef.h"

View file

@ -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

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_SX1276_H
#if !defined(_RADIOLIB_SX1276_H) && !defined(RADIOLIB_EXCLUDE_SX127X)
#define _RADIOLIB_SX1276_H
#include "../../TypeDef.h"

View file

@ -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

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_SX1277_H
#if !defined(_RADIOLIB_SX1277_H) && !defined(RADIOLIB_EXCLUDE_SX127X)
#define _RADIOLIB_SX1277_H
#include "../../TypeDef.h"

View file

@ -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

View file

@ -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
/*!

View file

@ -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

View file

@ -1,4 +1,4 @@
#ifndef _RADIOLIB_SX1279_H
#if !defined(_RADIOLIB_SX1279_H) && !defined(RADIOLIB_EXCLUDE_SX127X)
#define _RADIOLIB_SX1279_H
#include "../../TypeDef.h"

View file

@ -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

View file

@ -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