From 04a57ec059a95841c06fe63d4360871d162ed684 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Mon, 4 Jul 2022 14:54:31 +0800 Subject: [PATCH] sensors: joycon: use directions of joycon-r --- sensors/joycon/joycon.ha | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sensors/joycon/joycon.ha b/sensors/joycon/joycon.ha index b8e01ce..5fe8e4c 100644 --- a/sensors/joycon/joycon.ha +++ b/sensors/joycon/joycon.ha @@ -119,11 +119,11 @@ export fn next_sample(joycon: joycon) (sample | errors::error) = { case evdev::ABS_Y => joycon.read |= READ_Y; joycon.state.accelerometer.1 = - ev.value: f64 * ACCEL_SCALE; + -ev.value: f64 * ACCEL_SCALE; case evdev::ABS_Z => joycon.read |= READ_Z; joycon.state.accelerometer.2 = - ev.value: f64 * ACCEL_SCALE; + -ev.value: f64 * ACCEL_SCALE; case evdev::ABS_RX => joycon.read |= READ_RX; joycon.state.gyroscope.0 = @@ -131,11 +131,11 @@ export fn next_sample(joycon: joycon) (sample | errors::error) = { case evdev::ABS_RY => joycon.read |= READ_RY; joycon.state.gyroscope.1 = - ev.value: f64 * GYRO_SCALE; + -ev.value: f64 * GYRO_SCALE; case evdev::ABS_RZ => joycon.read |= READ_RZ; joycon.state.gyroscope.2 = - ev.value: f64 * GYRO_SCALE; + -ev.value: f64 * GYRO_SCALE; }; case evdev::EV_MSC => assert(ev.code == evdev::MSC_TIMESTAMP); -- 2.45.2