Repository navigation
Conversation
tozes
force-pushed
the
firmware/battery-indicator
branch
from
October 10, 2026 07:20
20a5152 to
42e69c4
Compare
An AMOLED pixel that is off draws no power, but the UI painted its background near black (rgb565(10,14,20)), so every background pixel was lit. DisplayInfo gains `emissive`; AmoledDisplay sets it (the 1.75, 1.75C and 1.8), and Ui uses black for the background on emissive panels. Backlit LCDs keep the near-black background, and the grey top and bottom bars on rectangular panels stay as they are. Test: "display: an emissive panel leaves its background unlit; a backlit one keeps near black".
Boards with a power driver can show the battery level: an icon, the percentage, both, or nothing (the default). It sits in the title bar on rectangular panels and centred at the top edge of round ones, above the UI square. The icon fills green while charging and turns red at 10% or less without USB; with the percentage alone, the number changes colour. It hides when there is no reading or no battery. Each select on Settings -> Battery and power moves to the next style and saves it; `set battery_display icon|percentage|both|off` does the same from the console. The NVS key is `battery_display` (15 characters): FakeHal::set now refuses keys longer than NVS allows, which caught the first name, `battery_indicator`. Tests in test_app.cpp: drawing on rectangular and round panels, colours, the tap cycle and what it saves, the settings page text, and boards without a power driver.
tozes
force-pushed
the
firmware/battery-indicator
branch
from
October 10, 2026 07:40
42e69c4 to
dcec1e2
Compare
4 of 5 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Boards with a power driver can show the battery level at the top of the screen: an icon, the percentage, both, or nothing (the default). It sits in the title bar on rectangular panels, and centred at the top edge of round ones, above the UI square. The icon fills green while charging and turns red at 10% or less without USB; with the percentage alone the number changes colour. It hides without a reading or without a battery.
Each select on Settings → Battery and power moves to the next style and saves it;
set battery_display icon|percentage|both|offdoes the same from the console.FakeHal::setnow refuses keys longer than NVS allows: the first key name,battery_indicator(17 characters), failed on the device and the tests didn't notice.Depends on #106. This branch includes those commits so it builds; review only the last commit, and it will be rebased as they merge.
Part of a series for the AMOLED-1.75C; the physical report is #103.
How you know it works
Tests on this branch (based on
8069101):hermes-gadget build-sim --test: core 126/126. Drawing on rectangular and round panels, colours, the tap cycle and what it saves, the page text, and boards without a power driver.pytestwithout the simulator-window tests (no virtual display here): 269 passed, 29 skipped.pio runbuilds:esp32s3-touch-amoled-175c,esp32s3-touch-amoled-18,esp32s3-breadboard. CI builds every board.Board: Waveshare ESP32-S3-Touch-AMOLED-1.75C, SKU 33691 (the unit in #103), with Hermes v0.21.6+199.g1744a19 on Fedora 44. The checks ran on builds of a working branch that combined this change with the others in this series (
30f8bc0); this branch's own image was not installed on its own.Physical: the indicator's placement on the round 466×466 panel, the tap cycle and the page text were checked on the 1.75C.
Documentation and sources
docs/using-gadget.md(settings row and a paragraph),docs/hardware.md(console keys; the percentage at the top) and a changelog line.Checklist