Skip to content
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

Fix stick calibration #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

paranoidduck
Copy link

@paranoidduck paranoidduck commented Aug 9, 2024

I was experiencing issues #8 / #18 on my NSO N64 controler.
Digging in the code, I found that min/max calibration are not properly set during nx_con_read_stick_calibration().
Hence, it always returns EINVAL (because returned calibration values don't satisfy "min < center < max").

According to dekuNukem joycon reverse engineering, the min and max values read from SPI are relative to the center.

So the actual calibration values should be center-min < center < center+max.

@paranoidduck
Copy link
Author

paranoidduck commented Aug 10, 2024

Reading more carefully issue #8, I realize you had already identified the commit which introduced the regression. And that I've just reintroduced the missing lines with this PR.

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.

1 participant