fix: preserve the board CPU clock by default

This commit is contained in:
github-actions[bot] committed 2026-11-12 13:51:02 -06:00
1 parent a06e59e77d
commit 5d703fe2a0
3 files changed
+12 -6

No files matched your search

+7 -4
View File
@@ -52,9 +52,10 @@ two costs that dominate idle:
Each knob is independent and each can be reverted with one command. The
defaults reproduce the pre-power-feature behaviour exactly — light sleep off,
RX duty cycle off (continuous RX), CPU at 240 MHz — so an existing installation
sees no change until it opts in. `set radio.rxps on` and `powersaving on` are
one command each; `cpu.freq 0` restores the board default.
RX duty cycle off (continuous RX), CPU at the board's compiled clock
(`ESP32_CPU_FREQ` where a variant sets it, otherwise 240 MHz) — so an existing
installation sees no change until it opts in. `set radio.rxps on` and
`powersaving on` are one command each; `cpu.freq 0` restores the board default.
## Behaviour
@@ -125,7 +126,9 @@ on-air protocol.
`set cpu.freq <mhz>` caps the CPU clock while the node is awake. Supported
values are **40, 80, 160 and 240**; `0` restores the frequency the board booted
with. The setting is applied immediately and again at boot.
with. A new install defaults to `0`, so a variant's compiled `ESP32_CPU_FREQ`
(80/160 MHz on many boards) is preserved until the operator asks otherwise. The
setting is applied immediately and again at boot.
Repeater work is I/O-bound: packet handling is dominated by SPI and airtime,
and the filter's pattern matcher is bounded by a **step budget**, not a time
+1 -1
View File
@@ -58,7 +58,7 @@ public:
char bridge_secret[16]; // for XOR encryption of bridge packets (ESP-NOW only)
// Power setting
uint8_t powersaving_enabled = 0; // boolean
uint16_t cpu_freq_mhz = 240; // ESP32 default; 0 = whatever the board booted with
uint16_t cpu_freq_mhz = 0; // 0 = whatever the board booted with (pre-feature default)
// Gps settings
uint8_t gps_enabled = 0;
uint32_t gps_interval = 0; // in seconds
+4 -1
View File
@@ -25,10 +25,13 @@ void powerApplyCpuFrequency(const NodePrefs& prefs) {
void powerApplyDefaults(NodePrefs& prefs) {
// Pre-power-feature behaviour: continuous RX, no CPU cap. The level/preamble
// defaults are carried so `set radio.rxps on` has something sane to start
// from, but nothing is armed until the operator asks for it.
// from, but nothing is armed until the operator asks for it. "No CPU cap"
// means the board's own clock (ESP32_CPU_FREQ where a variant sets it), not
// an assumed 240 MHz.
prefs.rxps.enabled = 0;
prefs.rxps.level = RX_POWERSAVING_BALANCED_LEVEL;
prefs.rxps.preamble = RX_POWERSAVING_PROFILE_PREAMBLE;
prefs.cpu_freq_mhz = 0;
}
void powerApplyRadioProfile(NodePrefs& prefs) {