summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vaccaro <nvaccaro@google.com>2014-05-06 15:19:21 -0700
committerNick Vaccaro <nvaccaro@google.com>2014-05-06 18:26:34 -0700
commite1df3ea6fb4c1af4069e0610a5a7a8634b786e99 (patch)
treebcf1fefab10f18e9f2258940cbdc0d7e0c9f0695
parent56fa6bff099c045ff4241c156309c6d94ac03f49 (diff)
downloadinvensense-e1df3ea6fb4c1af4069e0610a5a7a8634b786e99.tar.gz
Invensense: 6515: remember pedometer poll rate
The enableDmpPedometer call was hard-coding the pedometer poll period to 100mS. Save off the period passed to batch() as the new step count polling period instead of hard-coding it to 100mS. Bug: 14299562 Change-Id: Idc680c0a5d3c8bad7caf0db58336ea60d56a81de
-rw-r--r--6515/libsensors_iio/MPLSensor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/6515/libsensors_iio/MPLSensor.cpp b/6515/libsensors_iio/MPLSensor.cpp
index 5896a22..737fefb 100644
--- a/6515/libsensors_iio/MPLSensor.cpp
+++ b/6515/libsensors_iio/MPLSensor.cpp
@@ -1776,7 +1776,6 @@ int MPLSensor::enableDmpPedometer(int en, int interruptMode)
}
else {
mFeatureActiveMask |= INV_DMP_PEDOMETER_STEP;
- mStepCountPollTime = 100000000LL;
}
clock_gettime(CLOCK_MONOTONIC, &mt_pre);
@@ -5587,6 +5586,12 @@ int MPLSensor::batch(int handle, int flags, int64_t period_ns, int64_t timeout)
return 0;
}
+ if (what == StepCounter) {
+ mStepCountPollTime = period_ns;
+ LOGI("HAL: set step count poll time = %lld nS (%.2f Hz)",
+ mStepCountPollTime, 1000000000.f / mStepCountPollTime);
+ }
+
int tempBatch = 0;
if (timeout > 0) {
tempBatch = mBatchEnabled | (1 << what);