feat: add a screen cleaning lock for every deck - #12
Merged
Conversation
Wiping a touch deck fires whatever key is under the cloth, and page keys are switched by the firmware itself, so the host cannot suppress them. A new clean message swaps the deck for an overlay whose only live target is a centred hold, and deck_ui_handle_touch swallows every touch behind it. - Release needs the display lock the LVGL press callback already holds, so the five second hold is settled from deck_ui_poll and retried while the lock is busy - The lock outlives the USB link: the board re-announces it after a hello so a reconnecting desktop does not show a stale state - A sync landing mid-wipe stages the grid without lifting the lock, and the idle blank is suspended so the exit target stays lit - The overlay lives in deck_clean.c, keeping deck_ui.c under the component's line ceiling Co-authored-by: Cursor <cursoragent@cursor.com>
Exposes the board's cleaning lock two ways: a Clean screen key action, and a per-board toggle in Devices with a Clean all screens button once two capable boards are connected. The board is the source of truth. setCleanMode waits for the ack before marking a deck locked, and the unsolicited clean message the firmware sends after a five second hold clears the same state, so the UI follows a deck that was unlocked by hand. Boards without the clean-mode feature show no control and the key action reports that the firmware needs updating. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Wiping a touch deck fires whatever key is under the cloth. The host cannot
prevent it either, because page keys are switched by the firmware itself
without asking the desktop. This adds a cleaning lock that swallows every
touch on the panel.
Turning it on
in the header once two capable boards are connected.
Turning it off
it fills as you hold, and sliding off resets it.
Nothing else exits: taps outside the circle, page keys, and the idle blank are
all suppressed while the lock is on.
How it works
Host sends {type:clean,active:true} and the board replies
clean-ack. The board is the source of truth — the samecleanmessagearrives unprompted when the five second hold releases the lock, so the desktop
follows a deck that was unlocked by hand. The board also re-announces an
active lock after a hello, so a desktop that reconnects mid-wipe does not show
a stale state.
Gated on a new
clean-modehello feature: boards on older firmware show nocontrol, and the key action reports that the firmware needs updating.
Firmware goes to 0.3.0 on both boards, so they need a reflash from Devices
before the feature appears.
Notes for review
deck_ui_set_cleanneeds the display lock that the LVGL press callbackalready holds, so the hold is settled from
deck_ui_polland retried whilethe lock is busy.
loading it over the overlay.
deck_clean.csodeck_ui.cstays under thecomponent's 1000-line ceiling (913 now).
Verification
npm test(231 pass),npm run check, the board source tests, andbuild-catalog.js --validate-onlyall pass locally. The firmware is notcompiled locally — no ESP-IDF on this machine — so Board CI is the first
real compile of the C changes.