mirror of
https://github.com/agessaman/MeshCore.git
synced 2026-10-10 11:28:21 +00:00
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:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user