feat(nav): WaypointStore — persistent /waypoints table

Phase 3. Fixed 16-entry table of (lat, lon, ts, label[12]) persisted to
/waypoints with a magic+version header (mirrors TrailStore's format).
Unlike the RAM-only trail, waypoints are loaded in UITask::begin() and
rewritten on change via UITask::saveWaypoints(), so they survive reboots.

add/remove/rename/clear operate on the in-RAM table; the screen layer
(phase 5) drives persistence after each edit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-03 08:23:11 +02:00
co-authored by Claude Opus 4.8
parent 11c0b7c4a5
commit b1dfde5fcb
3 changed files with 126 additions and 0 deletions
+4
View File
@@ -23,6 +23,7 @@
#include "../AbstractUITask.h"
#include "../NodePrefs.h"
#include "../Trail.h"
#include "../Waypoint.h"
class UITask : public AbstractUITask {
DisplayDriver* _display;
@@ -78,6 +79,7 @@ class UITask : public AbstractUITask {
UIScreen* curr;
CayenneLPP _dash_lpp;
TrailStore _trail;
WaypointStore _waypoints;
uint32_t _next_trail_sample_ms = 0;
// Course-over-ground ring — a heading source independent of trail recording.
@@ -143,6 +145,8 @@ public:
void gotoAutoAdvertScreen();
void gotoTrailScreen();
TrailStore& trail() { return _trail; }
WaypointStore& waypoints() { return _waypoints; }
void saveWaypoints(); // persist the table to /waypoints
// Current course over ground in degrees (0..359), or false if not enough
// recent movement to derive a stable heading. Independent of trail logging.
bool currentCourse(int& deg_out) const;