Skip to content

Add charging indicator to companion_radio battery icon - #3054

Open
hansimgamr wants to merge 2 commits into
meshcore-dev:devfrom
hansimgamr:feat/t114-charging-indicator
Open

Add charging indicator to companion_radio battery icon#3054
hansimgamr wants to merge 2 commits into
meshcore-dev:devfrom
hansimgamr:feat/t114-charging-indicator

Conversation

@hansimgamr

@hansimgamr hansimgamr commented Jul 28, 2026

Copy link
Copy Markdown
IMG_7184 IMG_7185 ## What

Adds a charging indicator to the ui-new companion_radio home screen. While the device is externally powered, a small lightning-bolt icon is drawn just to the left of the battery indicator; once the battery reads full it switches to a plug icon.

The icon sits beside the battery rather than over it, so the fill bar stays clean and uninterrupted at every charge level. When a buzzer is present, the mute icon shifts one slot further left so the two never overlap.

How

  • Charging state comes from board.isExternalPowered(), so this works on any board that reports external power (e.g. the nRF52 VBUS-detect path).
  • Two new 8x8 XBM icons (charging_icon, plug_icon) in icons.h.
  • No display-driver changes; uses the existing UIColor theme (title_txt).

Testing

Built and flashed on a Heltec T114 (Heltec_t114_companion_radio_ble). Bolt appears on USB power, plug appears at 100%, and the battery bar is unaffected when running on battery.

🤖 Generated with Claude Code

hansimgamr and others added 2 commits July 28, 2026 12:06
Show a small lightning-bolt icon to the left of the battery indicator on
the ui-new home screen while the device is externally powered, and a plug
icon once the battery reads full. The bolt/plug sits beside the battery so
the fill bar stays clean and uninterrupted. When a buzzer is present, the
mute icon shifts one slot further left so the two never overlap.

Charging state is derived from board.isExternalPowered(), so this works on
any board that reports external power (e.g. the nRF52 VBUS-detect path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Boards without a charge-complete signal only infer "full" from voltage, and
a real pack rarely reads the full BATT_MAX_MILLIVOLTS (4.2V), so the plug icon
was effectively never shown. Treat "full" as a high band (>= 95%) so the plug
appears when the battery is charged rather than requiring an exact 100%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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