From 6469dac8331593b6a56bc3cad9f69b0639ba1e9d Mon Sep 17 00:00:00 2001 From: Felix Rusu Date: Mon, 7 Feb 2022 14:19:22 -0500 Subject: [PATCH] v1.5.1 - setPowerLevelDBm() fix https://lowpowerlab.com/forum/general-topics/power-levels-again/ --- RFM69.cpp | 7 ++++--- library.json | 2 +- library.properties | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/RFM69.cpp b/RFM69.cpp index a3adf61..ddba02c 100644 --- a/RFM69.cpp +++ b/RFM69.cpp @@ -282,12 +282,13 @@ int8_t RFM69::setPowerDBm(int8_t dBm) { else if (dBm>20) dBm=20; //map dBm to _powerLevel according to implementation in setPowerLevel() - if (dBm<17) setPowerLevel(2+dBm); - //else if (dBm<16) setPowerLevel(4+dBm); + if (dBm<12) setPowerLevel(2+dBm); + else if (dBm<16) setPowerLevel(4+dBm); else setPowerLevel(3+dBm); } else { //W/CW if (dBm<-18) dBm=-18; else if (dBm>13) dBm=13; + setPowerLevel(18+dBm); } return dBm; } @@ -947,7 +948,7 @@ void RFM69::set300KBPS() { writeReg(0x06, 0x33); //REG_FDEVLSB: 300khz (0x1333) writeReg(0x29, 240); //set REG_RSSITHRESH to -120dBm writeReg(0x37, 0b10010000); //DC=WHITENING, CRCAUTOOFF=0 - // ** DC: 00 none, 01 manchester, 10, whitening + // ^^->DC: 00=none, 01=manchester, 10=whitening } //============================================================================= diff --git a/library.json b/library.json index cd9c5d7..4e09b49 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "RFM69", - "version": "1.5.0", + "version": "1.5.1", "keywords": "rf, radio, wireless, spi", "description": "RFM69 library for RFM69W, RFM69HW, RFM69CW, RFM69HCW (semtech SX1231, SX1231H)", "repository": diff --git a/library.properties b/library.properties index 6d37178..826da0c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=RFM69_LowPowerLab -version=1.5.0 +version=1.5.1 author=LowPowerLab maintainer=Felix Rusu sentence=Simple Arduino library for RFM69/SX1231h based radio module transceivers