feat: complications, display config, handedness, graceful shutdown (PR 10/10) - #45
Merged
thePunderWoman merged 1 commit intoSep 8, 2026
Conversation
…R 10/10) Final PR of the firmware rewrite. Ties off every remaining thread from the plan: the "normal operating" screen now shows real data instead of a static boot message, and the power-off hold actually shuts the board down instead of just logging that it would. - complications.h/.cpp: ComplicationRegistry, the smartwatch-style slot->data-source mapping (battery, Left/Right slot label+value from the downlink, local signal strength, connected droid name, handedness). Pure, persisted via a thin NVS adapter (complication_persistence.cpp, joins the native exclusion list). - Display Config joins the menu tree (menu.h/.cpp): Up/Down selects a slot, Enter cycles its source, reusing PR 6's framework. MenuController also now tracks the most recently successfully-switched-to droid's name for the "Droid Name" source, and takes an externally-owned ComplicationRegistry* rather than duplicating slot-assignment state. - XbeeControl gains queryLocalRssiDbm() (local "DB" AT command — no round trip to Amidala needed, unlike everything else displayed). - UplinkPacket gains a flags byte (currently just kFlagShuttingDown) so Amidala can mark a controller disconnected immediately instead of waiting out a timeout. - SnipsController.ino: the operating screen now renders real complications (fed by battery/RSSI/droid-name every tick, downlink fields on receipt); the status LED reflects real state (error on latched charge fault, charging, connected within a 5s downlink timeout, else disconnected) instead of just settling on "disconnected" forever; the 3s power-button hold now runs a real graceful shutdown (notify Amidala via the flags bit, "Powering Off" OLED message, capped retries, then cuts the latch) instead of logging that PR 10 would handle it; the four menu-nav buttons (Left Up/Down, Stick Click, Bumper) now have their uplink bits suppressed while the menu is open, so navigating it doesn't look like spurious button presses to Amidala. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
thePunderWoman
deleted the
firmware-rewrite/pr10-complications-handedness-shutdown
branch
September 8, 2026 02:55
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.
Summary
PR 10 — the final PR of the firmware rewrite (PR 1: #35 ... PR 9: #44). Ties off every remaining thread from the plan: the "normal operating" screen now shows real data instead of a static boot message, and the power-off hold actually shuts the board down instead of just logging that it would.
complications.h/.cpp:ComplicationRegistry, the smartwatch-style slot→data-source mapping (battery, Left/Right slot label+value from the downlink, local signal strength, connected droid name, handedness). Pure, persisted via a thin NVS adapter (complication_persistence.cpp, joins the native exclusion list).MenuControlleralso now tracks the most recently successfully-switched-to droid's name for the "Droid Name" source, and takes an externally-ownedComplicationRegistry*rather than duplicating slot-assignment state.XbeeControlgainsqueryLocalRssiDbm()(localDBAT command — no round trip to Amidala needed, unlike everything else displayed).UplinkPacketgains aflagsbyte (currently justkFlagShuttingDown) so Amidala can mark a controller disconnected immediately instead of waiting out a timeout.SnipsController.ino:Test plan
pio test -e native— all 187 test cases passgcovr --exclude 'src/SnipsController\.ino' --exclude 'src/oled\.cpp' --exclude 'src/rgb_led\.cpp' --exclude 'src/calibration_store\.cpp' --exclude 'src/droid_persistence\.cpp' --exclude 'src/xbee_spi\.cpp' --exclude 'src/xbee_control\.cpp' --exclude 'src/complication_persistence\.cpp' --fail-under-line 90— 98.6% line coveragepio run -e esp32s3— builds successfullyThis closes out the plan's 10-PR sequence (originally 9; PR 8 split into two once it grew large enough on its own, per the plan's own contingency).
🤖 Generated with Claude Code