mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-04 11:16:13 +00:00
feat(ui): GPS breadcrumb phase 1 — storage, sampling, Summary view
Adds Tools › Breadcrumb. Enter on the screen toggles tracking; while active, UITask::loop samples GPS at the cadence chosen in settings (default 1 min) and drops the point into a 256-entry RAM ring guarded by a min-distance gate (default 25 m). A "G" indicator joins "A" in the status bar with the same blink convention. New storage: - examples/companion_radio/Breadcrumb.h — BreadcrumbStore class - 256 × 12 B = 3 KB RAM (survives auto-off, lost on reboot — explicit flash-slot save comes in phase 4) - Haversine min-delta gate, total distance, elapsed seconds, current km/h, bounding-box helper New screen: - examples/companion_radio/ui-new/BreadcrumbScreen.h — Summary view with Status, Points, Dist (m or km), Time (h:mm), Speed; Enter toggles tracking, Esc returns to Tools Schema bump 0xC0DE0002 → 0xC0DE0003 for two new NodePrefs bytes: breadcrumb_interval_idx (1min default) and breadcrumb_min_delta_idx (25m default). Older saves leave both at zero, which matches the new defaults. DataStore::loadPrefsInt/savePrefs read/write the pair. Logging on/off is a runtime flag inside BreadcrumbStore — not a preference — so reboot returns to the off state cleanly; the user will be able to persist a snapshot to a slot in phase 4. Phase 2 (map view), 3 (point list), 4 (slot save/load, GPX export over USB), and 5 (settings UI) follow incrementally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ccf45f0c0c
commit
adef2fceb9
@@ -99,11 +99,16 @@ struct NodePrefs { // persisted to file
|
||||
static const uint8_t FAVOURITE_PREFIX_LEN = 6;
|
||||
uint8_t favourite_contacts[FAVOURITES_COUNT][FAVOURITE_PREFIX_LEN];
|
||||
|
||||
// GPS breadcrumb cadence — indices into BreadcrumbStore::intervalSecs / minDeltaMeters.
|
||||
// Logging on/off is a runtime state (Tools › Breadcrumb), not a persisted preference.
|
||||
uint8_t breadcrumb_interval_idx; // 0..3: 1min / 30s / 5min / 15min
|
||||
uint8_t breadcrumb_min_delta_idx; // 0..2: 25m / 5m / 100m
|
||||
|
||||
// Tail sentinel written at the end of /new_prefs. Bump the low byte when
|
||||
// adding/removing/reordering fields in DataStore::savePrefs/loadPrefsInt so
|
||||
// older saves are detected on load and skipped (zero-init defaults kept).
|
||||
// High 24 bits identify the file format; low byte is the schema revision.
|
||||
static const uint32_t SCHEMA_SENTINEL = 0xC0DE0002;
|
||||
static const uint32_t SCHEMA_SENTINEL = 0xC0DE0003;
|
||||
|
||||
// Bit-index for each home page. Used by page_order (entries store bit+1) and
|
||||
// by home_pages_mask. Single source of truth — both HomeScreen::pageBit/bitToPage
|
||||
|
||||
Reference in New Issue
Block a user