Cleaned up formatting in header. Changed assigned value to set only the bit indicated in the documentation.

This commit is contained in:
Robert 2022-02-24 00:29:51 -05:00
parent da0cd455c9
commit ff43d95afa
2 changed files with 7 additions and 7 deletions

View file

@ -1057,7 +1057,7 @@ int16_t SX128x::setGainControl(uint8_t gain) {
ManualGainSetting |= 0x01; // Set bit 0 to 1 (Enable Automatic Gain Control) ManualGainSetting |= 0x01; // Set bit 0 to 1 (Enable Automatic Gain Control)
LNAGainValue &= 0xF0; // Bits 0, 1, 2 and 3 to 0 LNAGainValue &= 0xF0; // Bits 0, 1, 2 and 3 to 0
LNAGainValue |= 0x0A; // Set bits 0, 1, 2 and 3 to Manual Gain Setting (1-13) LNAGainValue |= 0x0A; // Set bits 0, 1, 2 and 3 to Manual Gain Setting (1-13)
LNAGainControl = 0x4D; // Set bit 7 to 0 (Enable Automatic Gain Control) LNAGainControl &= ~0x80; // Set bit 7 to 0 (Enable Automatic Gain Control)
} }
state = writeRegister(RADIOLIB_SX128X_REG_MANUAL_GAIN_CONTROL_ENABLE_2, &ManualGainSetting, 1); state = writeRegister(RADIOLIB_SX128X_REG_MANUAL_GAIN_CONTROL_ENABLE_2, &ManualGainSetting, 1);
RADIOLIB_ASSERT(state); RADIOLIB_ASSERT(state);

View file

@ -713,13 +713,13 @@ class SX128x: public PhysicalLayer {
*/ */
int16_t setAccessAddress(uint32_t addr); int16_t setAccessAddress(uint32_t addr);
/*! /*!
\brief Enables or disables receiver high sensitivity mode. \brief Enables or disables receiver high sensitivity mode.
\param True to enable and false to disable. \param True to enable and false to disable.
\returns 0 \returns 0
*/ */
int16_t setHighSensitivityMode(bool hsm = false); int16_t setHighSensitivityMode(bool hsm = false);
/*! /*!
@ -727,7 +727,7 @@ class SX128x: public PhysicalLayer {
\param Gain 0 automatic gain; 1 minimum gain to 13 maximum gain. \param Gain 0 automatic gain; 1 minimum gain to 13 maximum gain.
\returns \ref status_codes \returns 0
*/ */
int16_t setGainControl(uint8_t gain = 0); int16_t setGainControl(uint8_t gain = 0);