hgame_dpad_cb() previously exited early whenever conflicting directions were input (e.g., UP + DOWN) without saving said input to the hgame_softc state. This led to a desync between the driver and the gamepad. This patch instead handles conflicting inputs by cancelling them out with each other. Remove early return. Calculate axis value by subtraction.
Details
Details
Tested via evtest with a Raspberry Pi Pico (emulated as a gamepad)
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
don't have access to hardware to test this in a while, but logic looks sound!
| sys/dev/hid/hgame.c | ||
|---|---|---|
| 138 | No need for these parens. Ditto for others. | |