Skip to content

Fix wired DS4 PS/touchpad button masking in PS4 USB host parser#250

Open
0xSt0le wants to merge 1 commit into
wiredopposite:masterfrom
0xSt0le:fix-ds4-guide-ps-touchpad-mask-wired
Open

Fix wired DS4 PS/touchpad button masking in PS4 USB host parser#250
0xSt0le wants to merge 1 commit into
wiredopposite:masterfrom
0xSt0le:fix-ds4-guide-ps-touchpad-mask-wired

Conversation

@0xSt0le
Copy link
Copy Markdown

@0xSt0le 0xSt0le commented Apr 14, 2026

Fixes #209.

In Firmware/RP2040/src/USBHost/HostDriver/PS4/PS4.cpp, buttons[2] is masked with PS4::COUNTER_MASK (0xFC) before the PS and touchpad bits are checked. On wired DS4 USB reports, the PS and touchpad bits are the low two bits of buttons[2], so the current mask clears them before MAP_BUTTON_SYS / MAP_BUTTON_MISC are tested.

This line changes the mask to preserve the low two bits while clearing the counter bits:

in_report_.buttons[2] &= static_cast<uint8_t>(~PS4::COUNTER_MASK);

Tested:

  • Pi Pico
  • Waveshare RP2350-USB-A
  • Wired DS4
  • XInput mode
  • before fix: PS button did not register as Guide
  • after fix: PS button opens the Xbox Guide successfully

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.

Guide button not working on PS4 controller

1 participant