From ff43d95afa4d74176f6b2532989ac5b805325f53 Mon Sep 17 00:00:00 2001 From: Robert <3704942+JasonRJ@users.noreply.github.com> Date: Thu, 24 Feb 2022 00:29:51 -0500 Subject: [PATCH] Cleaned up formatting in header. Changed assigned value to set only the bit indicated in the documentation. --- src/modules/SX128x/SX128x.cpp | 2 +- src/modules/SX128x/SX128x.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/modules/SX128x/SX128x.cpp b/src/modules/SX128x/SX128x.cpp index a9241716..5f5ac79e 100644 --- a/src/modules/SX128x/SX128x.cpp +++ b/src/modules/SX128x/SX128x.cpp @@ -1057,7 +1057,7 @@ int16_t SX128x::setGainControl(uint8_t gain) { ManualGainSetting |= 0x01; // Set bit 0 to 1 (Enable Automatic Gain Control) 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) - 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); RADIOLIB_ASSERT(state); diff --git a/src/modules/SX128x/SX128x.h b/src/modules/SX128x/SX128x.h index 2537fe43..b86c3984 100644 --- a/src/modules/SX128x/SX128x.h +++ b/src/modules/SX128x/SX128x.h @@ -713,13 +713,13 @@ class SX128x: public PhysicalLayer { */ 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); /*! @@ -727,7 +727,7 @@ class SX128x: public PhysicalLayer { \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);