mirror of
https://github.com/safijari/openpuck.git
synced 2026-11-03 22:30:22 +00:00
[PR #224] [MERGED] Add configurable rumble style and strength #248
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#248
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/224
Author: @TheFilipcom4607
Created: 8/8/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @safijari
Base:
main← Head:rumble-shaping📝 Commits (2)
a52601fAdd configurable rumble style and strength9b6d91cMerge branch 'main' into rumble-shaping📊 Changes
11 files changed (+268 additions, -28 deletions)
View changed files
📝
CODE_MAP.md(+11 -5)📝
OpenPuck/config.cpp(+22 -5)📝
OpenPuck/haptics.cpp(+74 -4)📝
OpenPuck/haptics.h(+27 -2)📝
OpenPuck/serial_console.cpp(+37 -0)📝
OpenPuck/webusb_config.cpp(+43 -11)📝
OpenPuck/webusb_config.h(+2 -0)📝
README.md(+2 -0)📝
docs/PROTOCOL.md(+6 -1)📝
docs/TESTING_GUIDE.md(+3 -0)📝
docs/index.html(+41 -0)📄 Description
Adds two settings for host rumble in the translated modes (Xbox / Switch / PlayStation), where the puck decodes the host's rumble packet itself. Steam mode relays Steam's own haptics untouched and is unaffected.
Strength: a percentage of the amplitude the host asked for, 10–500%. 200% is the current fixed behaviour and remains the default, so nothing changes unless you touch it. This revives field 22 and the rsvd1 cfg byte the removed slider used, stored as percent/2 so the range fits one byte; the on-flash layout is unchanged and existing cfg.bin files still load.
Style: reshapes the two motor amplitudes before the scale: normal, mono (both at max), heavy (low only), light (high only), swapped, punchy (squared curve), soft (sqrt curve). New cfg tail field, so a config written by older firmware reads 0xFF and falls back to the default.
Panel gets a Rumble card with both selectors and a Test rumble button, new op 0x16, buzzes every linked controller for 500 ms through the same shaping path, auto-stopping in hapticTask() since the actuator latches. Note this also extends the parser's accepted opcode range to 0x16; anything added above 0x15 is dropped as garbage otherwise (found the hard way). Console gets RS, RY, TR. Protocol v20: strength back at blob p[53], style at new p[187], WB_PAYLEN 185→186. The panel hides the card on older firmware.
Integer-only math, hapticSteamRumble() runs in the USB OUT callback, so no float in an ISR. Shaping verified over all 65536 input amplitudes × all 7 styles at max scale: no overflow, monotonic.
Docs updated alongside: README (user-facing description), CODE_MAP (the rsvd1 entry described that byte as dead, it isn't any more), PROTOCOL (op 0x16 and fields 22/39), and the testing guide.
Bumps the status-blob version and adds a payload byte, so it will conflict with #219 if that lands first, happy to rebase.
Written with Claude, tested by me on my own hardware.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.