From 4f175bda3c953a54f5fe37717c7e22e9f8a11e80 Mon Sep 17 00:00:00 2001 From: MarekZegare4 Date: Wed, 24 Jun 2026 16:18:45 +0200 Subject: [PATCH] feat(companion): double the GPS trail buffer (512 -> 1024 points) RAM headroom allows it: +8KB resident (TrailStore::_buf), pushing static RAM to 73.0%/75.0% on GAT562/WioTrackerL1Eink respectively. On-disk snapshot format is unaffected (count is a uint16_t, already asserted to fit far past this); an old 512-point snapshot still loads fine on this firmware. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/Trail.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/Trail.h b/examples/companion_radio/Trail.h index cc8144f4..6b9e9aea 100644 --- a/examples/companion_radio/Trail.h +++ b/examples/companion_radio/Trail.h @@ -8,7 +8,7 @@ #include "GeoUtils.h" // RAM-only GPS trail ring buffer. -// Storage cost: CAPACITY(512) × sizeof(TrailPoint)(16 B, padded) = 8 KB, +// Storage cost: CAPACITY(1024) × sizeof(TrailPoint)(16 B, padded) = 16 KB, // always resident (UITask::_trail member). The trail survives auto-off (only // the display blanks) but is lost on reboot — user explicitly snapshots to a // LittleFS slot before powering down to keep it. @@ -24,7 +24,7 @@ static const uint8_t TRAIL_FLAG_SEG_START = 0x01; class TrailStore { public: - static const int CAPACITY = 512; + static const int CAPACITY = 1024; // _count is serialised as uint16_t in the save header — fail the build loudly // if CAPACITY is ever grown past what that can hold, rather than truncating. static_assert(CAPACITY <= 0xFFFF, "TrailStore::CAPACITY must fit in the uint16_t save-header count");