diff options
author | Saadi Maalem <saadi.maalem@intel.com> | 2015-11-11 17:44:51 +0100 |
---|---|---|
committer | Zhengyin Qian <qianzy@google.com> | 2015-11-11 14:00:13 -0800 |
commit | b219170d10f1c119ae79f39271239399cb373760 (patch) | |
tree | fc1bbef9f52e3ad787f3f17a53109376998c190f /libsensors_iio/src/StepCounter.cpp | |
parent | 4d9b8f68d6614c957803247f5f2970f0d91930c6 (diff) | |
download | sensors-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/StepCounter.cpp')
-rw-r--r-- | libsensors_iio/src/StepCounter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libsensors_iio/src/StepCounter.cpp b/libsensors_iio/src/StepCounter.cpp index 32575b3..7eecd81 100644 --- a/libsensors_iio/src/StepCounter.cpp +++ b/libsensors_iio/src/StepCounter.cpp @@ -26,7 +26,7 @@ StepCounter::StepCounter(HWSensorBaseCommonData *data, const char *name, sensor_t_data.flags |= SENSOR_FLAG_WAKE_UP; sensor_t_data.resolution = 1.0f; - sensor_t_data.maxRange = pow(2, data->channels[0].bits_used) - 1; + sensor_t_data.maxRange = pow(2.0, (double)data->channels[0].bits_used) - 1; num_data_axis = SENSOR_BASE_1AXIS; } |