summaryrefslogtreecommitdiff
path: root/60xx/libsensors_iio/MPLSensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to '60xx/libsensors_iio/MPLSensor.cpp')
-rw-r--r--60xx/libsensors_iio/MPLSensor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/60xx/libsensors_iio/MPLSensor.cpp b/60xx/libsensors_iio/MPLSensor.cpp
index 0aa6556..031ae6e 100644
--- a/60xx/libsensors_iio/MPLSensor.cpp
+++ b/60xx/libsensors_iio/MPLSensor.cpp
@@ -1588,6 +1588,10 @@ int MPLSensor::update_delay() {
inv_set_gyro_sample_rate(mplGyroRate);
inv_set_accel_sample_rate(mplAccelRate);
inv_set_compass_sample_rate(mplCompassRate);
+#ifdef LIBMLLITE_FROM_SOURCE
+ inv_set_linear_acceleration_sample_rate(rateInus);
+ inv_set_gravity_sample_rate(rateInus);
+#endif
/* TODO: Test 200Hz */
// inv_set_gyro_sample_rate(5000);
@@ -1884,9 +1888,10 @@ int MPLSensor::readEvents(sensors_event_t* /*data*/, int /*count*/) {
((mLocalSensorMask & INV_THREE_AXIS_ACCEL)? 6: 0)));
#endif
- if (rsize < (nbyte - 8)) {
+ if (rsize != nbyte) {
LOGE("HAL:ERR Full data packet was not read. rsize=%zd nbyte=%d sensors=%d errno=%d(%s)",
rsize, nbyte, sensors, errno, strerror(errno));
+ rsize = read(iio_fd, rdata, sizeof(mIIOBuffer));
return -1;
}