forked from atar-axis/xpadneo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hid-xpadneo, rumble: Throttle reprogramming of rumble motors
Thanks to @medusalix great findings that the controller crashes are most probably indeed a timing issue, this commit introduces a modified rumble protocol which throttles rumble commands sent to the controller. Also, it seems we cannot rely on `ff-memless` to only send us commands once per 50ms although that's the proposed time resolution of the protocol. It may depend on kernel HZ setting. This commit migrates the rumble worker into a delayed worker. When programming a rumble motor, we now remember the timing and allow the next reprogramming only 10ms+ in the future. Further requests will be buffered and the final command will be replayed to the controller when the delayed worker finally runs. Care was taken that we do not accidentally introduce a fixed lag of 10ms for rumble events. Maybe-fixes: atar-axis#180 Maybe-fixes: atar-axis#189 Signed-off-by: Kai Krakow <[email protected]>
- Loading branch information
Showing
1 changed file
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters