mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
feat(power): RX duty-cycle watchdog, noise-floor recal, GPS duty-cycling
Three power-saving additions, prompted by comparing this fork's existing RX duty-cycle support against IoTThinks/EasySkyMesh: - RX duty-cycle watchdog: the SX126x's hardware RX<->sleep sequencer runs with no MCU polling, so a desync (a known failure mode) previously had nothing watching for it. A new watchdog samples the BUSY pin every tick; no transition for too long triggers a soft re-arm, then a full chip reset (with cached radio params reapplied, since std_init() resets to compiled firmware defaults) if that doesn't clear it. Soft/hard recovery counts surface on Tools > Diagnostics > Live as "RXPS wd s/h". - Noise-floor recalibration during power-save: sampling was previously skipped entirely while duty-cycling, freezing int.thresh interference detection at whatever the floor was when power-save turned on. Now borrows a brief continuous-RX window once a minute to take a fresh reading before re-arming duty-cycle. - GPS duty-cycling (Settings > System > "GPS pwr"): cycles GPS off between fixes instead of running it continuously. Each wake waits for a fix (capped at 60s) before sleeping again for the configured interval. Repurposes the long-dead NodePrefs::gps_interval byte rather than adding a new persisted field. A "is anything live using GPS right now" hold in UITask keeps GPS continuously on whenever trail recording, live-share, an armed Locator, or the Compass/Nearby-navigate view actually need a live fix, so none of those features degrade. Locator crossing-state is reset on each wake so a still-settling first fix can't read as a false geofence crossing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,7 +62,7 @@ struct NodePrefs { // persisted to file
|
||||
uint8_t buzzer_quiet;
|
||||
uint8_t buzzer_volume; // 0=min..4=max, default 4
|
||||
uint8_t gps_enabled; // GPS enabled flag (0=disabled, 1=enabled)
|
||||
uint32_t gps_interval; // GPS read interval in seconds
|
||||
uint32_t gps_interval; // GPS duty-cycle sleep window in seconds (0 = disabled, GPS stays continuous)
|
||||
uint8_t autoadd_config; // bitmask for auto-add contacts config
|
||||
uint8_t rx_boosted_gain; // SX126x RX boosted gain mode (0=power saving, 1=boosted)
|
||||
uint8_t client_repeat;
|
||||
|
||||
Reference in New Issue
Block a user