OSDN Git Service

Fix incorrect timestamp on Malata accelerometer samples
authorPatrick Porlan <patrick.porlan@intel.com>
Mon, 2 Feb 2015 10:51:21 +0000 (11:51 +0100)
committerPatrick Porlan <patrick.porlan@intel.com>
Mon, 2 Feb 2015 10:51:21 +0000 (11:51 +0100)
Both accel and gyro samples are co-located on the same iio
device with the MPU-6050 drivers, all channels are enabled
at boot, so take them into account as the iio report size
is stable.

Change-Id: I678bed09b80d3565f81e9ef6db810d0da911c543
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
control.c

index 2bd6e17..a4ede96 100644 (file)
--- a/control.c
+++ b/control.c
@@ -1148,7 +1148,7 @@ static int integrate_device_report (int dev_num)
                }
 
        /* Align on a 64 bits boundary */
-       ts_offset = (ts_offset + 7)/8*8;
+       ts_offset = expected_dev_report_size[dev_num] - sizeof(int64_t);
 
        /* If we read an amount of data consistent with timestamp presence */
        if (len == expected_dev_report_size[dev_num])