radio: RX duty cycle (RXPS) from EasySkyMesh PowerSaving v18, opt-in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-12 14:57:16 +01:00
1 parent 507842cea2
commit b06fd957b9
14 files changed
+1386 -1

No files matched your search

+9
View File
@@ -862,6 +862,9 @@ void SensorMesh::begin(FILESYSTEM* fs) {
radio_driver.setParams(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
radio_driver.setTxPower(_prefs.tx_power_dbm);
#ifdef WITH_RX_POWERSAVING
_prefs.getRadioPrefs()->applyRxPowerSaving(_prefs.sf, _prefs.bw); // CUSTOM (TeTeHacko)
#endif
board.attachDynamicPrefs(_prefs.getCustom());
@@ -1024,12 +1027,18 @@ void SensorMesh::loop() {
if (set_radio_at && millisHasNowPassed(set_radio_at)) { // apply pending (temporary) radio params
set_radio_at = 0; // clear timer
radio_driver.setParams(pending_freq, pending_bw, pending_sf, pending_cr);
#ifdef WITH_RX_POWERSAVING
_prefs.getRadioPrefs()->applyRxPowerSaving(pending_sf, pending_bw);
#endif
MESH_DEBUG_PRINTLN("Temp radio params");
}
if (revert_radio_at && millisHasNowPassed(revert_radio_at)) { // revert radio params to orig
revert_radio_at = 0; // clear timer
radio_driver.setParams(_prefs.freq, _prefs.bw, _prefs.sf, _prefs.cr);
#ifdef WITH_RX_POWERSAVING
_prefs.getRadioPrefs()->applyRxPowerSaving(_prefs.sf, _prefs.bw);
#endif
MESH_DEBUG_PRINTLN("Radio params restored");
}