mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
The previous implementation derived "Time" and "Avg speed" from the RTC: first().ts and rtc_clock.getCurrentTime(). When the RTC isn't synced yet (no GPS time fix, no host sync), every point ts is 0, the current time is 0 too, and elapsed stays at 0 — Time never moves and Avg speed reads 0 even with the map filling in. Real-world breakage. Switch the elapsed/avg-speed timebase to millis(): - TrailStore gains _session_start_ms (millis() when the current start→stop window opened) and _accumulated_ms (banked time across previous windows). - setActive(true) records the start; setActive(false) banks the delta into the accumulator. - elapsedSeconds = (_accumulated_ms + active session delta) / 1000. - clear() zeroes both. Per-point ts stays RTC-derived (used for the HH:MM labels in List view where a wallclock is what the user actually wants). TrailScreen drops the now_ts argument it was passing in, and bumps the refresh interval to 1 s while active so the m:ss counter actually ticks every second. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>