mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-17 01:44:25 +00:00
RXPS: use measured preamble-symbol capture model
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user