diff --git a/src/modules/SX126x/SX126x.cpp b/src/modules/SX126x/SX126x.cpp index 716971c5a..74178eb1f 100644 --- a/src/modules/SX126x/SX126x.cpp +++ b/src/modules/SX126x/SX126x.cpp @@ -6,6 +6,7 @@ SX126x::SX126x(Module* mod) : PhysicalLayer(RADIOLIB_SX126X_FREQUENCY_STEP_SIZE, RADIOLIB_SX126X_MAX_PACKET_LENGTH) { this->mod = mod; this->XTAL = false; + this->standbyXOSC = false; } int16_t SX126x::begin(uint8_t cr, uint8_t syncWord, uint16_t preambleLength, float tcxoVoltage, bool useRegulatorLDO) { @@ -463,7 +464,7 @@ int16_t SX126x::sleep(bool retainConfig) { } int16_t SX126x::standby() { - return(SX126x::standby(RADIOLIB_SX126X_STANDBY_RC)); + return(SX126x::standby(this->standbyXOSC ? RADIOLIB_SX126X_STANDBY_XOSC : RADIOLIB_SX126X_STANDBY_RC)); } int16_t SX126x::standby(uint8_t mode, bool wakeup) { diff --git a/src/modules/SX126x/SX126x.h b/src/modules/SX126x/SX126x.h index f02d5f7d3..848433b8c 100644 --- a/src/modules/SX126x/SX126x.h +++ b/src/modules/SX126x/SX126x.h @@ -447,6 +447,11 @@ class SX126x: public PhysicalLayer { */ bool XTAL; + /*! + \brief Whether to use XOSC (true) or RC (false) oscillator in standby mode. Defaults to false. + */ + bool standbyXOSC; + // basic methods /*!