Fix remote LNA toggle bugs: correct register comparison, add missing implementations, wire up companion radio

getRxBoostedGain was returned true because both 0x94 (power saving) and
0x96 (boosted gain = 1) return true
This commit is contained in:
Wessel Nieboer
2026-02-24 23:49:06 +01:00
parent f4951d0895
commit 8bf63256b6
10 changed files with 32 additions and 15 deletions

View File

@@ -803,6 +803,13 @@ MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMe
_prefs.gps_enabled = 0; // GPS disabled by default
_prefs.gps_interval = 0; // No automatic GPS updates by default
//_prefs.rx_delay_base = 10.0f; enable once new algo fixed
#if defined(USE_SX1262) || defined(USE_SX1268)
#ifdef SX126X_RX_BOOSTED_GAIN
_prefs.sx126x_rx_boosted_gain = SX126X_RX_BOOSTED_GAIN;
#else
_prefs.sx126x_rx_boosted_gain = 1; // enabled by default
#endif
#endif
}
void MyMesh::begin(bool has_display) {
@@ -869,6 +876,11 @@ void MyMesh::begin(bool has_display) {
radio_set_params(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
radio_set_tx_power(_prefs.tx_power_dbm);
#if defined(USE_SX1262) || defined(USE_SX1268)
radio_set_rx_boosted_gain_mode(_prefs.sx126x_rx_boosted_gain);
MESH_DEBUG_PRINTLN("SX126x RX Boosted Gain Mode: %s",
radio_get_rx_boosted_gain_mode() ? "Enabled" : "Disabled");
#endif
}
const char *MyMesh::getNodeName() {