Repository navigation
Firmware: the AMOLED-1.75C's PWR key sleeps and wakes the screen - #111
Merged
Merged
Conversation
This was referenced Oct 9, 2026
tozes
force-pushed
the
firmware/175c-pwr-key
branch
from
October 10, 2026 07:20
c58ecce to
983a893
Compare
On the 1.75C, PWR reaches only the AXP2101 (there is no TCA9554 to mirror it), so the firmware never saw it. The AXP2101 latches a short press in IRQ status 1 (0x49) bit 3 when IRQ enable 1 (0x41) bit 3 is set. The driver enables that bit, and the app polls it every 100 ms through a new Power::take_key_press() hook, clearing it by writing the bit back. A short press turns the screen off (the same screen sleep as Screen timeout, with or without a timeout set) and the next press, a touch or BOOT turns it back on; Wi-Fi and the Hermes connection stay up. Holding PWR keeps the PMIC's own power-off. Other boards are unchanged. Register bits from X-Powers' AXP2101 datasheet (SWcharge v1.0, 6.13). Tests: five in test_app.cpp (off and on without a timeout, other input only wakes, a prompt wakes, a lost connection wakes, a dimmed screen comes back), and the driver's read-once-and-clear in test_power.cpp.
tozes
force-pushed
the
firmware/175c-pwr-key
branch
from
October 10, 2026 07:40
983a893 to
ced532b
Compare
tozes
marked this pull request as ready for review
October 10, 2026 13:56
4 of 5 tasks
Owner
|
Thanks @tozes, merged. The driver test is careful: it checks that enabling the key keeps the other interrupt enables, drops a press latched before boot, and doesn't clear the long-press bit. Polling through I pushed three commits on top:
Looking forward to the next batch. |
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
On the 1.75C, PWR reaches only the AXP2101 (no TCA9554 mirrors it), so the firmware never saw it. The AXP2101 latches a short press in IRQ status 1 (
0x49, bit 3) when IRQ enable 1 (0x41, bit 3) is set. The driver enables that bit, and the app polls it every 100 ms through a newPower::take_key_press()hook, clearing it by writing the bit back.A short press turns the screen off (the same screen sleep as Screen timeout, with or without a timeout set), and the next press, a touch or BOOT turns it back on; Wi-Fi and the Hermes connection stay up. Holding PWR keeps the PMIC's own power-off. Other boards are unchanged.
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 127/127. Five app tests (off and on without a timeout, other input only wakes, a prompt wakes, a lost connection wakes, a dimmed screen returns) and the driver's read-once-and-clear intest_power.cpp.pytestwithout the simulator-window tests (no virtual display here): 269 passed, 29 skipped.pio runbuilds:esp32s3-touch-amoled-175c,esp32s3-touch-amoled-175. 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: short presses turned the screen off and on, a touch woke it, and holding PWR still forced the board off.
Documentation and sources
docs/hardware.md(the 1.75C controls and AXP2101 row),docs/using-gadget.mdand a changelog line. Register bits from X-Powers' AXP2101 datasheet (SWcharge v1.0, section 6.13), already linked fromhardware.md.Checklist