From 91d42ebf0e1f8eac5c1387e9cd7e8db0843944a2 Mon Sep 17 00:00:00 2001 From: jgromes Date: Wed, 18 Jan 2023 18:58:52 +0100 Subject: [PATCH] [SX127x] Set minimum bit rate to 0.5 kbps (#665) --- src/modules/SX127x/SX127x.cpp | 5 +++-- src/modules/SX127x/SX127x.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/SX127x/SX127x.cpp b/src/modules/SX127x/SX127x.cpp index b6e4441a..5052cc69 100644 --- a/src/modules/SX127x/SX127x.cpp +++ b/src/modules/SX127x/SX127x.cpp @@ -823,10 +823,11 @@ int16_t SX127x::setBitRate(float br) { } // check allowed bit rate + // datasheet says 1.2 kbps should be the smallest possible, but 0.512 works fine if(_ook) { - RADIOLIB_CHECK_RANGE(br, 1.2, 32.768002, RADIOLIB_ERR_INVALID_BIT_RATE); // Found that 32.768 is 32.768002 + RADIOLIB_CHECK_RANGE(br, 0.5, 32.768002, RADIOLIB_ERR_INVALID_BIT_RATE); // Found that 32.768 is 32.768002 } else { - RADIOLIB_CHECK_RANGE(br, 1.2, 300.0, RADIOLIB_ERR_INVALID_BIT_RATE); + RADIOLIB_CHECK_RANGE(br, 0.5, 300.0, RADIOLIB_ERR_INVALID_BIT_RATE); } // set mode to STANDBY diff --git a/src/modules/SX127x/SX127x.h b/src/modules/SX127x/SX127x.h index e7502c15..13083b64 100644 --- a/src/modules/SX127x/SX127x.h +++ b/src/modules/SX127x/SX127x.h @@ -902,7 +902,7 @@ class SX127x: public PhysicalLayer { float getDataRate() const; /*! - \brief Sets FSK bit rate. Allowed values range from 1.2 to 300 kbps. Only available in FSK mode. + \brief Sets FSK bit rate. Allowed values range from 0.5 to 300 kbps. Only available in FSK mode. \param br Bit rate to be set (in kbps).