mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
The Clock-page Batt% field used a separate hardcoded linear mapping (3000-4200 mV → 0-100%) that disagreed with the top-bar battery indicator, which uses a piecewise LiPo discharge curve and the user-configurable low_batt_mv cutoff (Settings → Low battery threshold) as the 0% anchor. The two readings could differ by 25+ percentage points for the same voltage, and the dashboard ignored the cutoff setting entirely. Extract battMvToPercent(mv, low_mv) as a file-static helper so both the top-bar indicator and the dashboard field share the same curve and the same cutoff source. Drop the stray BATT_MIN/MAX_MILLIVOLTS #defines that leaked from inside the dashboard code paths into the rest of the TU. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>