From 59c4fe638fa93c87311d0be26463664cf6aa0e26 Mon Sep 17 00:00:00 2001 From: jgromes Date: Mon, 6 Jul 2020 11:48:02 +0200 Subject: [PATCH] [RFM9x] Synced parameters of all LoRa modules --- src/modules/RFM9x/RFM95.cpp | 6 +++--- src/modules/RFM9x/RFM95.h | 5 +---- src/modules/RFM9x/RFM96.cpp | 7 ++++--- src/modules/RFM9x/RFM96.h | 5 +---- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/modules/RFM9x/RFM95.cpp b/src/modules/RFM9x/RFM95.cpp index 80db42a6..f2b4a302 100644 --- a/src/modules/RFM9x/RFM95.cpp +++ b/src/modules/RFM9x/RFM95.cpp @@ -5,12 +5,12 @@ RFM95::RFM95(Module* mod) : SX1278(mod) { } -int16_t RFM95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) { +int16_t RFM95::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, uint8_t gain) { // execute common part - int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, currentLimit, preambleLength); + int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, preambleLength); if(state == ERR_CHIP_NOT_FOUND) { // SX127X_REG_VERSION might be set 0x12 - state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, currentLimit, preambleLength); + state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, preambleLength); RADIOLIB_ASSERT(state); } else if(state != ERR_NONE) { // some other error diff --git a/src/modules/RFM9x/RFM95.h b/src/modules/RFM9x/RFM95.h index 8c760630..f6c02840 100644 --- a/src/modules/RFM9x/RFM95.h +++ b/src/modules/RFM9x/RFM95.h @@ -47,9 +47,6 @@ class RFM95: public SX1278 { \param power Transmission output power in dBm. Allowed values range from 2 to 17 dBm. - \param currentLimit Trim value for OCP (over current protection) in mA. Can be set to multiplies of 5 in range 45 to 120 mA and to multiples of 10 in range 120 to 240 mA. - Set to 0 to disable OCP (not recommended). - \param preambleLength Length of %LoRa transmission preamble in symbols. The actual preamble length is 4.25 symbols longer than the set number. Allowed values range from 6 to 65535. @@ -58,7 +55,7 @@ class RFM95: public SX1278 { \returns \ref status_codes */ - int16_t begin(float freq = 915.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 17, uint8_t currentLimit = 100, uint16_t preambleLength = 8, uint8_t gain = 0); + int16_t begin(float freq = 915.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 10, uint16_t preambleLength = 8, uint8_t gain = 0); // configuration methods diff --git a/src/modules/RFM9x/RFM96.cpp b/src/modules/RFM9x/RFM96.cpp index 5ca6f594..c2f43f0e 100644 --- a/src/modules/RFM9x/RFM96.cpp +++ b/src/modules/RFM9x/RFM96.cpp @@ -5,12 +5,12 @@ RFM96::RFM96(Module* mod) : SX1278(mod) { } -int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) { +int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint16_t preambleLength, uint8_t gain) { // execute common part - int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, currentLimit, preambleLength); + int16_t state = SX127x::begin(RFM9X_CHIP_VERSION_OFFICIAL, syncWord, preambleLength); if(state == ERR_CHIP_NOT_FOUND) { // SX127X_REG_VERSION might be set 0x12 - state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, currentLimit, preambleLength); + state = SX127x::begin(RFM9X_CHIP_VERSION_UNOFFICIAL, syncWord, preambleLength); RADIOLIB_ASSERT(state); } else if(state != ERR_NONE) { // some other error @@ -38,6 +38,7 @@ int16_t RFM96::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncW RADIOLIB_ASSERT(state); state = setGain(gain); + RADIOLIB_ASSERT(state); return(state); } diff --git a/src/modules/RFM9x/RFM96.h b/src/modules/RFM9x/RFM96.h index 9bafe6ea..c18019b2 100644 --- a/src/modules/RFM9x/RFM96.h +++ b/src/modules/RFM9x/RFM96.h @@ -47,9 +47,6 @@ class RFM96: public SX1278 { \param power Transmission output power in dBm. Allowed values range from 2 to 17 dBm. - \param currentLimit Trim value for OCP (over current protection) in mA. Can be set to multiplies of 5 in range 45 to 120 mA and to multiples of 10 in range 120 to 240 mA. - Set to 0 to disable OCP (not recommended). - \param preambleLength Length of %LoRa transmission preamble in symbols. The actual preamble length is 4.25 symbols longer than the set number. Allowed values range from 6 to 65535. @@ -58,7 +55,7 @@ class RFM96: public SX1278 { \returns \ref status_codes */ - int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 17, uint8_t currentLimit = 100, uint16_t preambleLength = 8, uint8_t gain = 0); + int16_t begin(float freq = 434.0, float bw = 125.0, uint8_t sf = 9, uint8_t cr = 7, uint8_t syncWord = SX127X_SYNC_WORD, int8_t power = 10, uint16_t preambleLength = 8, uint8_t gain = 0); // configuration methods