Implement remote lna toggle cli cmd

This commit is contained in:
João Brázio 2026-02-10 14:56:20 +00:00
parent 3f33455b4d
commit 71136671bd
No known key found for this signature in database
GPG key ID: 56A1490716A324DD
171 changed files with 925 additions and 27 deletions

View file

@ -801,6 +801,14 @@ MyMesh::MyMesh(mesh::MainBoard &board, mesh::Radio &radio, mesh::MillisecondCloc
_prefs.advert_loc_policy = ADVERT_LOC_PREFS;
_prefs.adc_multiplier = 0.0f; // 0.0f means use default board multiplier
#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(FILESYSTEM *fs) {
@ -821,6 +829,12 @@ void MyMesh::begin(FILESYSTEM *fs) {
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
updateAdvertTimer();
updateFloodAdvertTimer();

View file

@ -234,4 +234,10 @@ public:
// To check if there is pending work
bool hasPendingWork() const;
#if defined(USE_SX1262) || defined(USE_SX1268)
void setRxBoostedGain(bool enable) override {
radio_set_rx_boosted_gain_mode(enable);
}
#endif
};