wake_hid.h 1.4 KB

1234567891011121314151617181920
  1. // wake_hid.h -- a minimal boot-protocol HID interface whose ONLY job is to make the device a host-recognized
  2. // USB wake source.
  3. //
  4. // Every mode already advertises remote-wakeup in its config descriptor (the Adafruit core sets
  5. // TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP), so the device is *armed* to wake the host. But hosts only *honor* a
  6. // remote-wakeup resume signal from an allow-listed input device class -- a HID keyboard/mouse. Windows
  7. // (especially under Modern Standby) ignores the wake from a bare gamepad / vendor / composite presentation
  8. // even though it's armed. Exposing a boot MOUSE interface (the same shape Xbox mode already uses to wake
  9. // Windows) puts the device in that allow-list. It never sends reports -- the actual wake is the device-level
  10. // USBDevice.remoteWakeup() resume signal driven from rf_link.cpp; this interface only changes how the host
  11. // classifies us. (A boot keyboard was tried and was worse -- it didn't enumerate on Windows.)
  12. //
  13. // Added for every clean mode AND for puck mode on a normal boot: puck mode drops its CDC serial console by
  14. // default (freeing the endpoint this interface needs) so it too can wake Windows. The exception is the one-shot
  15. // debug boot, where CDC is kept and this interface is skipped (no endpoint room for both) -- see config.h
  16. // (g_debugCdcThisBoot) and ARCHITECTURE.md.
  17. #pragma once
  18. // register the boot-keyboard wake interface (call from setup() for clean modes)
  19. void wakeHidBegin();