RXPS: use measured preamble-symbol capture model

This commit is contained in:
Jarosław Domański
2026-09-05 00:02:13 +02:00
parent fde20d37d0
commit 6bbd34a296
15 changed files with 1090 additions and 189 deletions
+3 -1
View File
@@ -278,7 +278,9 @@ static void applyCompanionRxPowerSaving(uint8_t sf, float bw) {
uint32_t rx_us = 0;
uint32_t sleep_us = 0;
bool ok = calcRxPowerSavingLevel(RX_POWERSAVING_BALANCED_LEVEL, sf, bw,
RX_POWERSAVING_PROFILE_PREAMBLE, &rx_us, &sleep_us) &&
RX_POWERSAVING_PROFILE_PREAMBLE, &rx_us, &sleep_us,
rxPowerSavingCaptureCost(control),
rxPowerSavingTransition(control)) &&
control->setRxPowerSaving(true, rx_us, sleep_us);
if (!ok) {
control->setRxPowerSaving(false, RX_POWERSAVING_DEFAULT_RX_US,
+2 -1
View File
@@ -11,8 +11,9 @@ static RxPowerSavingControl* getRxPowerSavingControl() {
}
static void applyRxPowerSavingConfig(NodePrefs& prefs, uint8_t sf, float bw) {
normalizeRxPowerSavingConfig(&prefs.rxps, sf, bw);
RxPowerSavingControl* control = getRxPowerSavingControl();
normalizeRxPowerSavingConfig(&prefs.rxps, sf, bw, rxPowerSavingCaptureCost(control),
rxPowerSavingTransition(control));
bool ok = control != nullptr
? control->setRxPowerSaving(
prefs.rxps.enabled != 0, prefs.rxps.rx_us, prefs.rxps.sleep_us)