mirror of
https://github.com/liquidraver/ZephCore.git
synced 2026-10-15 07:19:56 +00:00
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:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user