~xdavidwu/motion-control

04a57ec059a95841c06fe63d4360871d162ed684 — xdavidwu 2 years ago 2bb5086
sensors: joycon: use directions of joycon-r
1 files changed, 4 insertions(+), 4 deletions(-)

M sensors/joycon/joycon.ha
M sensors/joycon/joycon.ha => sensors/joycon/joycon.ha +4 -4
@@ 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);