From 0975741edb62f6699277e1cda060fbcbb4ed5c20 Mon Sep 17 00:00:00 2001 From: Jan-Michael Brummer Date: Fri, 10 Jul 2015 22:24:05 +0200 Subject: [PATCH] accel: Apply scale for IIO buffered acceleration Always apply the scale from the IIO readings. This fixes acceleration values on the Dell Venue 11 Pro (7140) tablet. --- src/drv-iio-buffer-accel.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drv-iio-buffer-accel.c b/src/drv-iio-buffer-accel.c index ecfa75a..296f181 100644 --- a/src/drv-iio-buffer-accel.c +++ b/src/drv-iio-buffer-accel.c @@ -67,9 +67,9 @@ process_scan (IIOSensorData data, DrvData *or_data) accel_y = -accel_y; //FIXME report errors - readings.accel_x = accel_x; - readings.accel_y = accel_y; - readings.accel_z = accel_z; + readings.accel_x = accel_x * scale; + readings.accel_y = accel_y * scale; + readings.accel_z = accel_z * scale; or_data->callback_func (&iio_buffer_accel, (gpointer) &readings, or_data->user_data); return 1;