summaryrefslogtreecommitdiff
path: root/libsensors_iio/src/Accelerometer.cpp
diff options
context:
space:
mode:
authorSaadi Maalem <saadi.maalem@intel.com>2015-11-11 17:44:51 +0100
committerZhengyin Qian <qianzy@google.com>2015-11-11 14:00:13 -0800
commitb219170d10f1c119ae79f39271239399cb373760 (patch)
treefc1bbef9f52e3ad787f3f17a53109376998c190f /libsensors_iio/src/Accelerometer.cpp
parent4d9b8f68d6614c957803247f5f2970f0d91930c6 (diff)
downloadsensors-b219170d10f1c119ae79f39271239399cb373760.tar.gz
sensor: generate flush_complete event when data timestamps matches
Generating a flush_complete event right after receiving a flush_request from the sensor services breaks the flow as the client stops acquiring data. Solution is to store the timestamp of the flush request and issue the flush_complete event when the timestamp of the sensor data matches Change-Id: Idb273db3e69e6e2593c00298d3d458fc7c965830 Signed-off-by: Fei Li <feix.f.li@intel.com> Signed-off-by: Guillaume Ranquet <guillaumex.ranquet@intel.com>
Diffstat (limited to 'libsensors_iio/src/Accelerometer.cpp')
-rw-r--r--libsensors_iio/src/Accelerometer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsensors_iio/src/Accelerometer.cpp b/libsensors_iio/src/Accelerometer.cpp
index dc9d8c7..5c9cadc 100644
--- a/libsensors_iio/src/Accelerometer.cpp
+++ b/libsensors_iio/src/Accelerometer.cpp
@@ -27,7 +27,7 @@ Accelerometer::Accelerometer(HWSensorBaseCommonData *data, const char *name,
sensor_t_data.flags |= SENSOR_FLAG_WAKE_UP;
sensor_t_data.resolution = data->channels[0].scale;
- sensor_t_data.maxRange = sensor_t_data.resolution * (pow(2, data->channels[0].bits_used - 1) - 1);
+ sensor_t_data.maxRange = sensor_t_data.resolution * (pow(2.0, data->channels[0].bits_used - 1.0) - 1);
}
Accelerometer::~Accelerometer()