nicman23 / dkms-hid-nintendo

dkms-hid-nintendo
GNU General Public License v2.0
240 stars 43 forks source link

Check analog user calibration for plausibility #25

Closed bitmeal closed 3 years ago

bitmeal commented 3 years ago

Cheap clone controllers may (falsely) report as having a user calibration for the analog sticks in place, but return wrong/impossible values for the actual calibration data. In the present case at mine, the controller reports having a user calibration in place and successfully executes the read commands. The reported user calibration however is min = center = max = 0.

This pull request addresses problems of this kind by checking the provided user calibration-data for plausibility (min < center < max) and falling back to the default values if implausible.