-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for 045e:0202 duke xbox controller and fix analog hat readings #818
Add support for 045e:0202 duke xbox controller and fix analog hat readings #818
Conversation
I've submitted two additional commits to the PR to fix the indicated concerns (printReport open coding and analog hat endianness fix using void pointer arithmetic). |
Do you want me to squash the fixes for raised concerts into the feature commits to keep history simple and avoid non-working points in repository history? (I'm not so used to github and established workflows, although I have raw git experience). |
The 045e:0202 "Microsoft X-Box pad v1 (US)" uses endpoint 2 both for IN and OUT, while 045e:0289 "Microsoft X-Box pad v2 (US)" uses endpoint 1 for IN and endpoint 2 for OUT. Instead of hardcoding endpoints, read them from configuration descriptors to make all controllers work. Without this patch, 045e:0202 does not work. Signed-off-by: Albert Herranz <[email protected]>
Properly read left and right analog hat values as 16bit little endian integers. Signed-off-by: Albert Herranz <[email protected]>
13d42f4
to
ca39e3a
Compare
I ended up squashing the fixes into their original commits (rebase). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Looks great. Thanks for cleaning up the commits :) |
Btw don't worry about the CI. I'll fix that. |
The current code uses hardcoded endpoints to read/write to original Xbox controllers. This works for controllers like 045e:0289 which uses the same endpoint configuration as the hardcoded one.
But other original Xbox controllers like 045e:0202 do not follow the hardcoded configuration and end up not working (can't read reports from them).
This PR modifies the XBOXOLD code to determine endpoints by reading configuration descriptors as in the XBOXONE, instead of hardcoding them. This makes both kind of controllers work.
On this same PR a patch to properly read the left and right analog hats is included too.