radiolib: reapply runtime RX boosted gain on SX126x AGC reset

sx126xResetAGC only restored the gain when the build defined
SX126X_RX_BOOSTED_GAIN, so a gain set at runtime was lost on reset.
Match lr11x0ResetAGC and always reapply. Also pass the gain state from
the LLCC68 wrapper, whose call did not match the helper's signature.
This commit is contained in:
agessaman
2026-09-23 21:56:27 -07:00
parent f4f394c0d7
commit a94f510f27
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ public:
}
uint8_t getSpreadingFactor() const override { return ((CustomLLCC68 *)_radio)->spreadingFactor; }
void doResetAGC() override { sx126xResetAGC((SX126x *)_radio); }
void doResetAGC() override { sx126xResetAGC((SX126x *)_radio, getRxBoostedGainMode()); }
bool supportsRxBoostedGain() const override { return true; }
bool setRxBoostedGainMode(bool en) override {
+1 -2
View File
@@ -25,9 +25,8 @@ inline void sx126xResetAGC(SX126x* radio, bool rx_boost_gain) {
#ifdef SX126X_DIO2_AS_RF_SWITCH
radio->setDio2AsRfSwitch(SX126X_DIO2_AS_RF_SWITCH);
#endif
#ifdef SX126X_RX_BOOSTED_GAIN
// always reapply: the gain may have been changed at runtime even when no build default is set
radio->setRxBoostedGainMode(rx_boost_gain);
#endif
#ifdef SX126X_REGISTER_PATCH
uint8_t r_data = 0;
radio->readRegister(0x8B5, &r_data, 1);