radio: extract CadController and NoiseFloorEstimator, one prefs source

- CadController (stats, window, re-anchor, visits, staircase, safety,
  starvation relax) and NoiseFloorEstimator split out of LoRaRadioBase
  behind a 4-call CadHw interface; Zephyr-free, host unit tests added
- prefs mandatory: setPrefs() before begin(), LoRaConfig fallbacks and the
  companion/observer placeholder prefs removed; LoRaConfig is the one
  defaults source (invalid-prefs fallback now uses the board TX default)
- TX-wait thread stack owned by the base; reconfigureWithParams removed
- driver extension headers on the public include path
  (zephyr/drivers/lora/*.h); patch 0003 include updated
- comment diet (image-identical); rationale moved to devdocs LLD 03
This commit is contained in:
liquidraver
2026-09-23 14:33:29 +02:00
parent a7d073900e
commit fd2cbe9d62
36 changed files with 935 additions and 1629 deletions
+6 -5
View File
@@ -5,6 +5,7 @@
#include "RepeaterDataStore.h"
#include "../adapters/datastore/ZephyrFsFormat.h"
#include <helpers/LoRaConfig.h>
#include <zephyr/fs/fs.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
@@ -325,11 +326,11 @@ bool RepeaterDataStore::loadPrefs(NodePrefs& prefs) {
prefs.bw < ZC_RADIO_BW_MIN_KHZ || prefs.bw > ZC_RADIO_BW_MAX_KHZ) {
LOG_WRN("Invalid radio params in prefs, using defaults: freq=%.3f sf=%u bw=%.1f",
(double)prefs.freq, prefs.sf, (double)prefs.bw);
prefs.freq = 869.618f;
prefs.bw = 62.5f;
prefs.sf = 7;
prefs.cr = 5;
prefs.tx_power_dbm = 22;
prefs.freq = mesh::LoRaConfig::FREQ_MHZ;
prefs.bw = mesh::LoRaConfig::BANDWIDTH_KHZ;
prefs.sf = mesh::LoRaConfig::SPREADING_FACTOR;
prefs.cr = mesh::LoRaConfig::CODING_RATE;
prefs.tx_power_dbm = mesh::LoRaConfig::TX_POWER_DBM;
}
/* Everything else that came off flash — bounds, NaNs, and the char fields,
* which the file format stores without terminators. */