Input: adafruit-seesaw: fix "flat" value to avoid drifting
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 Input: adafruit-seesaw: fix "flat" value to avoid drifting
From: Michael Opdenacker <[email protected]>
Tests on 9 Adafruit Mini I2C Gamepad devices have shown that
the center X and Y values (when the joystick is left at its center position) deviate from 511, which is the center of the [0, 1023] value range:
Device Center X Vs. Expected (511) Center Y Vs. Expected (511) 1 519 8 493 -18 2 524 13 518 7 Not very stable data! 3 508 -3 531 20 4 531 20 508 -3 5 505 -6 521 10 6 519 8 477 -34 Big outlier, ignored! 7 519 8 524 13 8 524 13 510 -1 9 517 6 511 0
This change causes any X and Y value that is withing a [-20, +20] interval around 511, to be reported as centered. This avoids unwanted drifting (towards left, right, top or bottom) and makes playing with this device easier.
Signed-off-by Michael Opdenacker <[email protected]>
--- drivers/input/joystick/adafruit-seesaw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/adafruit-seesaw.c +1 -1
@@ -50,7 +50,7 @@#define SEESAW_JOYSTICK_MAX_AXIS 1023#define SEESAW_JOYSTICK_FUZZ 2 -#define SEESAW_JOYSTICK_FLAT 4 +#define SEESAW_JOYSTICK_FLAT 20#define SEESAW_GAMEPAD_POLL_INTERVAL_MS 16#define SEESAW_GAMEPAD_POLL_MIN 8