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

+13
View File
@@ -1514,6 +1514,9 @@ void MyMesh::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
radio_driver.setRxBoostedGainMode(_prefs.rx_boosted_gain);
MESH_DEBUG_PRINTLN("RX Boosted Gain Mode: %s",
@@ -1938,12 +1941,18 @@ void MyMesh::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); // timing is in symbols
#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");
}
@@ -1971,6 +1980,10 @@ void MyMesh::loop() {
bool MyMesh::hasPendingWork() const {
#if defined(WITH_BRIDGE)
if (bridge.isRunning()) return true; // bridge needs WiFi radio, can't sleep
#endif
#ifdef WITH_RX_POWERSAVING
// no MCU sleep while the noise-floor window samples RSSI
if (radio_driver.isRxPowerSavingCalibrationActive()) return true;
#endif
return _mgr->getOutboundTotal() > 0;
}