mirror of
https://github.com/safijari/openpuck.git
synced 2026-11-03 22:30:22 +00:00
[PR #235] Add MODE_WAKE: smart-power-on wake personality (Lenovo Alt+P) #254
Labels
No labels
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
safijari/openpuck#254
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/safijari/openpuck/pull/235
Author: @Saffsanity
Created: 8/16/2026
Status: 🔄 Open
Base:
main← Head:mode-wake-v2📝 Commits (7)
a13fea1Add MODE_WAKE: boot-keyboard personality for firmware smart power on643384fSurface MODE_WAKE in the panel, README, and CODE_MAPb2822baDocument wake mode: setup guide for smart-power-on hosts36e1b44MODE_WAKE: configurable hotkey + generic "Keyboard wake" namingb36c1acWAKE_AUTO_REARM: rearm-on-connect + instant arming on rearm bootsc8fa60bReview fixes: gesture-only rearm marker, wrap-safe window, off-exemption, hotkey validation7e703b5WAKE_AUTO_REARM: mark timer/dead-bus rearms when nothing was on the air📊 Changes
15 files changed (+1264 additions, -45 deletions)
View changed files
📝
CODE_MAP.md(+30 -2)📝
OpenPuck/OpenPuck.ino(+37 -15)📝
OpenPuck/config.cpp(+57 -7)📝
OpenPuck/config.h(+36 -1)📝
OpenPuck/controllers.cpp(+3 -0)📝
OpenPuck/haptics.cpp(+152 -3)➕
OpenPuck/mode_wake.cpp(+449 -0)➕
OpenPuck/mode_wake.h(+198 -0)📝
OpenPuck/rf_link.cpp(+39 -7)📝
OpenPuck/rf_link.h(+5 -0)📝
OpenPuck/serial_console.cpp(+1 -1)📝
OpenPuck/webusb_config.cpp(+25 -3)📝
README.md(+1 -0)➕
docs/WAKE_MODE.md(+172 -0)📝
docs/index.html(+59 -6)📄 Description
Summary
Adds MODE_WAKE (mode 10): a bare boot-protocol keyboard personality that powers on a fully shut-down (S5) host through firmware "smart power on" (Lenovo: Alt+P from the always-on USB port). Arm it, shut down, and the next controller power-button press types the hotkey and boots the machine — by the time the OS is up, the puck is a normal puck again and the controller has reconnected by itself. One press, end to end. USB remote wakeup only covers S3 sleep; this covers real power-on.
Nothing changes for anyone who doesn't use it: mode 10 is only entered explicitly (panel / console
x10/ assignable chord),WAKE_AUTO_REARMis compile-time off, the new suspend-policy logic is inert outside the wake flow, and the cfg layout is byte-identical (a dead reserved byte is repurposed; oldcfg.binfiles load unchanged).User guide: docs/WAKE_MODE.md — BIOS setup, the designated port, LED diagnostics, auto-rearm trade-offs, adapting the hotkey to other vendors.
How it works
bareHidgating). Also endpoint budget: the puck composite already uses 6 of 7 IN endpoints.#defines (mode_wake.h), as is the hotkey for other vendors.Cfg.wakeHandoff— flash, because this board class's bootloader wipes.noinitRAM on reset): during POST the bus looks suspended or dead, and without the grace the standing suspend power-off kills the controller that just triggered the wake, whileWAKE_AUTO_REARMwould swap the puck for a keyboard mid-boot. The return boot also skips the USB mount wait and opens the RF connect cooldown, so the triggering controller relinks in under 0.5 s (measured 0.424 s) instead of giving up during POST.WAKE_AUTO_REARM(opt-in) is sleep-aware: an OS entering S3 armsDEVICE_REMOTE_WAKEUPbefore suspending (the existing wake-from-S3 path depends on it); a shutdown never does. The decision is sampled once per down-episode from a mounted host, because the tested EC re-arms the feature itself during its S5 port takeover. Both observed takeover styles are handled — suspend-style (connection kept) and bus-reset-style (TinyUSB'ssuspended()can never read true again; a dead-bus clock measured from bus loss covers it).Validation
Hardware-validated end-to-end on a Lenovo ThinkCentre M90q Gen 6 (SteamOS), including the
WAKE_AUTO_REARM=1build, across a dozen power cycles: S5 wake (single press, controller self-reconnects), S3 sleep (puck stays a puck; controller wake-from-sleep keeps working), controller auto-power-off at shutdown, arming-race negative test, and the escape chord. Not yet exercised on a Windows host. Five multi-agent adversarial review rounds were run during development with a converging finding count; every confirmed finding is fixed in this diff. Full development history, hardware captures, and review records: #234.WAKE_AUTO_REARMvariants compile clean (arduino-cli, adafruit:nrf52 1.7.0)Open question for maintainer
Identity is
28DE:574B— Valve VID with an invented PID, following the ReversePuck28DE:1302precedent. Happy to change (pid.codes would be the principled alternative if you'd rather avoid another invented Valve PID).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.