Skip to content

Idle header channel indicator, stable battery percent, full-screen warnings - #16

Merged
bin101 merged 3 commits into
mainfrom
feat/header-channel-battery-warning
Jul 25, 2026
Merged

Idle header channel indicator, stable battery percent, full-screen warnings#16
bin101 merged 3 commits into
mainfrom
feat/header-channel-battery-warning

Conversation

@bin101

@bin101 bin101 commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Show the selected radio group channel as CHn right next to the nickname in the idle header, so it's a permanent glanceable reminder instead of being buried in the settings menu.
  • Smooth the INA219 battery voltage with an EMA before it feeds the percent curve, low-battery latch, and the heartbeat's battery field — fixes the displayed percent flickering back and forth under normal load noise.
  • Rework the incoming-warning screen to use the two-tone panel deliberately: the affected rider's name fills the yellow strip, the warning label auto-fits the largest font from a size ladder in the blue region (word-wrapping to two lines when needed), for the full 15s display duration.

Test plan

  • pio run — firmware builds clean (Flash 11.3%, RAM 7.2%)
  • pio test -e native — all 78 existing unit tests pass, no regressions
  • Flash to a real device and verify on the actual two-tone OLED: CHn renders correctly next to the name across all channel values (0-9); battery percent no longer flickers under load; each warning label (CAR BEHIND, HAZARD AHEAD, BRAKING/STOP, REGROUP/WAIT, ATTENTION!) renders large and legible without clipping, in both one-line and two-line cases

bin101 added 3 commits July 25, 2026 13:55
The group's radio channel was only visible buried in the settings menu.
Show it as CHn right after the nickname on the idle screen so it's a
permanent, glanceable reminder of which of the 10 channels the device is on.
The displayed battery percent was recomputed every ~1s from a raw, unfiltered
INA219 voltage reading. Because the percent curve is steep in its middle
segments (~0.2 %/mV), a few mV of load-induced noise per read showed up as
the header percent jumping back and forth. Apply an EMA to the cached
millivolts before the percent curve ever sees them (BATTERY_EMA_ALPHA_PERCENT),
which also stabilizes the low-battery latch and the battery value sent to
peers via the heartbeat.
Incoming hazard warnings need to be unmissable at a glance while riding.
Rework the warning screen around the two-tone panel instead of fighting it:
the affected rider's name fills the yellow strip (who), and the warning
label auto-fits the largest font from a size ladder in the blue region below
(what), word-wrapping to two lines when needed. Stays large for the full
15s display duration; short-click dismiss still works.
@bin101
bin101 merged commit 11e1bdb into main Jul 25, 2026
2 checks passed
@bin101
bin101 deleted the feat/header-channel-battery-warning branch July 25, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant