Merge pull request #17 from Dom4n/rxps_v2

RXPS v2
This commit is contained in:
IoTThinks authored and GitHub committed 2026-09-06 14:32:56 +07:00
commit e76da0fefa
15 files changed
+1090 -189

No files matched your search

+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)