Skip to content

Fix keyboard not responding after USB wake from sleep#4

Open
jkquickstar wants to merge 1 commit intoEpomaker:mainfrom
jkquickstar:fix/usb-wake-from-sleep
Open

Fix keyboard not responding after USB wake from sleep#4
jkquickstar wants to merge 1 commit intoEpomaker:mainfrom
jkquickstar:fix/usb-wake-from-sleep

Conversation

@jkquickstar
Copy link
Copy Markdown

Summary

  • Bug: Keyboard becomes unresponsive after the host computer wakes from sleep when connected via USB. Users must unplug and replug the cable to restore functionality.
  • Root cause: In usb_remote_wakeup() (non-USB_REMOTE_USE_QMK path), suspend_power_down() is called when USB enters suspended state, but suspend_wakeup_init() is never called when USB returns to active — leaving keyboard subsystems (matrix scanning, etc.) in a shut-down state.
  • Fix: Track suspend state with a bool flag and call suspend_wakeup_init() on resume, matching the pattern used in QMK's own suspend handling.

Test plan

  • Built firmware successfully from the hangshengkeji/qmk_firmware fork (which shares this same linker/wireless/transport.c code)
  • Flashed to Epomaker Tide75 keyboard
  • Verified keyboard responds correctly after host wakes from sleep (previously required unplug/replug)
  • Verified normal USB operation is unaffected

🤖 Generated with Claude Code

When the host computer suspends, usb_remote_wakeup() calls
suspend_power_down() to put the keyboard into a low-power state.
However, when the host resumes and USB transitions out of SUSPENDED
state, suspend_wakeup_init() is never called, leaving keyboard
subsystems (matrix scanning, etc.) in a shut-down state. This
requires the user to physically unplug and replug the USB cable.

Add a `suspended` flag to track whether suspend_power_down() was
called, and call suspend_wakeup_init() when USB returns to active
state. This mirrors the pattern used in the USB_REMOTE_USE_QMK
code path and in QMK's own suspend handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jkquickstar jkquickstar marked this pull request as draft February 18, 2026 16:07
@jkquickstar jkquickstar marked this pull request as ready for review February 18, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant