cad improvements

This commit is contained in:
liquidraver
2026-09-01 22:05:29 +02:00
parent efa5240b69
commit ba33cebf6a
27 changed files with 1559 additions and 292 deletions
+16 -2
View File
@@ -780,7 +780,10 @@ public:
lora_radio.setCadParams(companion_mesh.prefs.cad_auto != 0,
companion_mesh.prefs.cad_offset,
companion_mesh.prefs.probe_interval,
companion_mesh.prefs.cad_busycap);
companion_mesh.prefs.cad_busycap,
companion_mesh.prefs.cad_base);
companion_mesh.prefs.cad_offset = lora_radio.getCadOffset();
companion_mesh.prefs.cad_base = lora_radio.cadBasePeak();
}
void resetCadStats() override {
lora_radio.resetCadStats();
@@ -1626,7 +1629,18 @@ int main(void)
lora_radio.setCadParams(companion_mesh.prefs.cad_auto != 0,
companion_mesh.prefs.cad_offset,
companion_mesh.prefs.probe_interval,
companion_mesh.prefs.cad_busycap);
companion_mesh.prefs.cad_busycap,
companion_mesh.prefs.cad_base);
/* Write back the (offset, base) actually in force. setCadParams() may
* have re-anchored the offset across a base-table change, and the pair
* has to be persisted for the NEXT upgrade to have an anchor of its own.
* Guarded so a node whose base has not moved never writes flash at boot. */
if (companion_mesh.prefs.cad_base != lora_radio.cadBasePeak() ||
companion_mesh.prefs.cad_offset != lora_radio.getCadOffset()) {
companion_mesh.prefs.cad_offset = lora_radio.getCadOffset();
companion_mesh.prefs.cad_base = lora_radio.cadBasePeak();
data_store.savePrefs(companion_mesh.prefs);
}
/* LR2021 side detectors (multi-SF RX) from prefs. extra_sf is a
* zero-terminated list; a rejected set (SF/BW changed since it was
+12 -1
View File
@@ -786,7 +786,18 @@ int main(void)
lora_radio.setFemRxEnable(prefs->fem_rxgain != 0);
lora_radio.enableRxDutyCycle(prefs->rx_duty_cycle != 0);
lora_radio.setCadParams(prefs->cad_auto != 0, prefs->cad_offset,
prefs->probe_interval, prefs->cad_busycap);
prefs->probe_interval, prefs->cad_busycap,
prefs->cad_base);
/* Write back the (offset, base) actually in force. setCadParams() may
* have re-anchored the offset across a base-table change, and the pair
* has to be persisted for the NEXT upgrade to have an anchor of its own.
* Guarded so a node whose base has not moved never writes flash at boot. */
if (prefs->cad_base != lora_radio.cadBasePeak() ||
prefs->cad_offset != lora_radio.getCadOffset()) {
prefs->cad_offset = lora_radio.getCadOffset();
prefs->cad_base = lora_radio.cadBasePeak();
repeater_mesh.savePrefs();
}
/* LR2021 side detectors (multi-SF RX) from prefs. extra_sf is a
* zero-terminated list; a rejected set (SF/BW changed since it was
+12 -1
View File
@@ -671,7 +671,18 @@ int main(void)
lora_radio.setFemRxEnable(prefs->fem_rxgain != 0);
lora_radio.enableRxDutyCycle(prefs->rx_duty_cycle != 0);
lora_radio.setCadParams(prefs->cad_auto != 0, prefs->cad_offset,
prefs->probe_interval, prefs->cad_busycap);
prefs->probe_interval, prefs->cad_busycap,
prefs->cad_base);
/* Write back the (offset, base) actually in force. setCadParams() may
* have re-anchored the offset across a base-table change, and the pair
* has to be persisted for the NEXT upgrade to have an anchor of its own.
* Guarded so a node whose base has not moved never writes flash at boot. */
if (prefs->cad_base != lora_radio.cadBasePeak() ||
prefs->cad_offset != lora_radio.getCadOffset()) {
prefs->cad_offset = lora_radio.getCadOffset();
prefs->cad_base = lora_radio.cadBasePeak();
room_mesh.savePrefs();
}
/* LR2021 side detectors (multi-SF RX) from prefs. extra_sf is a
* zero-terminated list; a rejected set (SF/BW changed since it was