Update SX1278.cpp Turn on LnaBoost even in AutoAGC mode

LnaBoost can still be enabled when the gain is not manually set.
The Receiver Sensitivity ratings in the SX1276/7/8 datasheet are specified with the LnaBoost enabled.

I tested this on a few boards here and on average get a 3dB increase in signal strength. This is comparable to the SX1262 "Boosted Gain" setting
This commit is contained in:
Nate Welch 2024-07-18 09:20:59 -05:00 committed by GitHub
parent 858bf6409e
commit 3985c2edc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -380,6 +380,7 @@ int16_t SX1278::setGain(uint8_t gain) {
if(gain == 0) {
// gain set to 0, enable AGC loop
state |= mod->SPIsetRegValue(RADIOLIB_SX1278_REG_MODEM_CONFIG_3, RADIOLIB_SX1278_AGC_AUTO_ON, 2, 2);
state |= mod->SPIsetRegValue(RADIOLIB_SX127X_REG_LNA, RADIOLIB_SX127X_LNA_BOOST_ON, 1, 0);
} else {
state |= mod->SPIsetRegValue(RADIOLIB_SX1278_REG_MODEM_CONFIG_3, RADIOLIB_SX1278_AGC_AUTO_OFF, 2, 2);
state |= mod->SPIsetRegValue(RADIOLIB_SX127X_REG_LNA, (gain << 5) | RADIOLIB_SX127X_LNA_BOOST_ON);