summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChing Tzung Lin <ctlin@google.com>2015-07-21 21:50:20 -0700
committerChing Tzung Lin <ctlin@google.com>2015-07-23 15:55:14 -0700
commit980569f04a36cc492e61c357a1c06d2386b0586f (patch)
tree3b660e7168c55afdc2f6a95ed01fc26ad332ed7b
parente0c1691f695f828608c36315fa405db2fa8d153e (diff)
downloadinvensense-980569f04a36cc492e61c357a1c06d2386b0586f.tar.gz
Fix compilation error on emerald-dev
Bug:21922216 Change-Id: I072a7be00bb2e42c20f2ddc980706f552ff28c64
-rwxr-xr-x6515/libsensors_iio/InputEventReader.cpp1
-rw-r--r--6515/libsensors_iio/MPLSensor.cpp37
-rwxr-xr-x6515/libsensors_iio/SensorBase.cpp1
-rwxr-xr-x6515/libsensors_iio/sensors_mpl.cpp9
4 files changed, 31 insertions, 17 deletions
diff --git a/6515/libsensors_iio/InputEventReader.cpp b/6515/libsensors_iio/InputEventReader.cpp
index 968e32e..5ec3e6c 100755
--- a/6515/libsensors_iio/InputEventReader.cpp
+++ b/6515/libsensors_iio/InputEventReader.cpp
@@ -20,6 +20,7 @@
#include <errno.h>
#include <unistd.h>
#include <poll.h>
+#include <string.h>
#include <sys/cdefs.h>
#include <sys/types.h>
diff --git a/6515/libsensors_iio/MPLSensor.cpp b/6515/libsensors_iio/MPLSensor.cpp
index ad6d4e9..054303e 100644
--- a/6515/libsensors_iio/MPLSensor.cpp
+++ b/6515/libsensors_iio/MPLSensor.cpp
@@ -117,20 +117,6 @@ MPLSensor::MPLSensor(CompassSensor *compass, int (*m_pt2AccelCalLoadFunc)(long *
mAccelBiasApplied(false),
mPendingMask(0),
mSensorMask(0),
- mMplFeatureActiveMask(0),
- mFeatureActiveMask(0),
- mDmpOn(0),
- mPedUpdate(0),
- mPressureUpdate(0),
- mQuatSensorTimestamp(0),
- mStepSensorTimestamp(0),
- mLastStepCount(-1),
- mLeftOverBufferSize(0),
- mInitial6QuatValueAvailable(0),
- mFlushBatchSet(0),
- mSkipReadEvents(0),
- mDataMarkerDetected(0),
- mEmptyDataMarkerDetected(0),
mGyroBatchRate(0),
mAccelBatchRate(0),
mCompassBatchRate(0),
@@ -144,7 +130,20 @@ MPLSensor::MPLSensor(CompassSensor *compass, int (*m_pt2AccelCalLoadFunc)(long *
mResetRate(0),
mDataInterrupt(0),
mFirstBatchCall(1),
- mEnableCalled(1) {
+ mEnableCalled(1),
+ mMplFeatureActiveMask(0),
+ mFeatureActiveMask(0),
+ mDmpOn(0),
+ mPedUpdate(0),
+ mPressureUpdate(0),
+ mQuatSensorTimestamp(0),
+ mStepSensorTimestamp(0),
+ mLastStepCount(-1),
+ mLeftOverBufferSize(0),
+ mInitial6QuatValueAvailable(0),
+ mSkipReadEvents(0),
+ mDataMarkerDetected(0),
+ mEmptyDataMarkerDetected(0) {
VFUNC_LOG;
inv_error_t rv;
@@ -5759,7 +5758,11 @@ int MPLSensor::batch(int handle, int flags, int64_t period_ns, int64_t timeout)
LOGV_IF(PROCESS_VERBOSE,
"HAL:batch after applying upper and lower limit: %llu ns, (%.2f Hz)",
- period_ns, 1000000000.f / period_ns);
+ period_ns, 1000000000.f / period_ns);
+
+ LOGV_IF(PROCESS_VERBOSE,
+ "HAL:batch after applying upper and lower limit: %llu ns, (%.2f Hz)",
+ period_ns, 1000000000.f / period_ns);
switch (what) {
case Gyro:
@@ -6543,7 +6546,7 @@ int MPLSensor::calcBatchDataRates(int64_t *gyro_rate, int64_t *accel_rate, int64
#ifdef ENABLE_PRESSURE
int64_t pressureRate;
#endif
- int64_t quatRate;
+ int64_t quatRate = 0;
int mplGyroRate;
int mplAccelRate;
diff --git a/6515/libsensors_iio/SensorBase.cpp b/6515/libsensors_iio/SensorBase.cpp
index 544ac15..a2b38c3 100755
--- a/6515/libsensors_iio/SensorBase.cpp
+++ b/6515/libsensors_iio/SensorBase.cpp
@@ -24,6 +24,7 @@
#include <sys/select.h>
#include <cutils/log.h>
#include <linux/input.h>
+#include <string.h>
#include <cutils/properties.h>
diff --git a/6515/libsensors_iio/sensors_mpl.cpp b/6515/libsensors_iio/sensors_mpl.cpp
index 7e7b06b..c55e86c 100755
--- a/6515/libsensors_iio/sensors_mpl.cpp
+++ b/6515/libsensors_iio/sensors_mpl.cpp
@@ -81,6 +81,14 @@ static struct hw_module_methods_t sensors_module_methods = {
open: open_sensors
};
+static int sensors_set_operation_mode(unsigned int mode)
+{
+ LOGI("%s", __FUNCTION__);
+ LOGI("%s: stub function: ignoring mode request (%d)", __FUNCTION__,
+ mode);
+ return 0;
+}
+
struct sensors_module_t HAL_MODULE_INFO_SYM = {
common: {
tag: HARDWARE_MODULE_TAG,
@@ -94,6 +102,7 @@ struct sensors_module_t HAL_MODULE_INFO_SYM = {
reserved: {0}
},
get_sensors_list: sensors__get_sensors_list,
+ set_operation_mode: sensors_set_operation_mode
};
struct sensors_poll_context_t {