diff options
author | Nick Vaccaro <nvaccaro@google.com> | 2014-06-12 18:14:05 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-12 18:14:05 +0000 |
commit | 1105b979f3a3eb01bd7f5d517adb1ef40df3ba09 (patch) | |
tree | 1e574a5b95a31ef9a0586497aaa6fd646e453cba /6515 | |
parent | 027da058871b3a6b6c581a718fe6b1d1903a9379 (diff) | |
parent | d0ba40f540b676dcea65f8db04c1220aa43c2ea3 (diff) | |
download | invensense-1105b979f3a3eb01bd7f5d517adb1ef40df3ba09.tar.gz |
am d0ba40f5: am 9478d39a: Invensense: 6515: fix compass data reporting when pedometer on
* commit 'd0ba40f540b676dcea65f8db04c1220aa43c2ea3':
Invensense: 6515: fix compass data reporting when pedometer on
Diffstat (limited to '6515')
-rw-r--r-- | 6515/libsensors_iio/MPLSensor.cpp | 6 | ||||
-rw-r--r-- | 6515/libsensors_iio/MPLSensor.h | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/6515/libsensors_iio/MPLSensor.cpp b/6515/libsensors_iio/MPLSensor.cpp index d1a9e7a..c63d8b4 100644 --- a/6515/libsensors_iio/MPLSensor.cpp +++ b/6515/libsensors_iio/MPLSensor.cpp @@ -2595,7 +2595,7 @@ int MPLSensor::compassHandler(sensors_event_t* s) s->magnetic.v[0], s->magnetic.v[1], s->magnetic.v[2], s->timestamp, update); mCompassAccuracy = s->magnetic.status; - return update; + return update | mCompassOverFlow; } int MPLSensor::rawCompassHandler(sensors_event_t* s) @@ -2620,7 +2620,7 @@ int MPLSensor::rawCompassHandler(sensors_event_t* s) LOGV_IF(HANDLER_DATA, "HAL:compass raw data: %+f %+f %+f %d -- %lld - %d", s->uncalibrated_magnetic.uncalib[0], s->uncalibrated_magnetic.uncalib[1], s->uncalibrated_magnetic.uncalib[2], s->magnetic.status, s->timestamp, update); - return update; + return update | mCompassOverFlow; } /* @@ -3689,6 +3689,7 @@ int MPLSensor::readEvents(sensors_event_t* data, int count) } } } + mCompassOverFlow = 0; return numEventReceived; } @@ -3981,6 +3982,7 @@ LOGV_IF(INPUT_DATA, else if (data_format == DATA_FORMAT_COMPASS_OF) { LOGV_IF(ENG_VERBOSE && INPUT_DATA, "COMPASS OF DETECTED:0x%x", data_format); mask |= DATA_FORMAT_COMPASS_OF; + mCompassOverFlow = 1; readCounter -= BYTES_PER_SENSOR; } #ifdef ENABLE_PRESSURE diff --git a/6515/libsensors_iio/MPLSensor.h b/6515/libsensors_iio/MPLSensor.h index bdaee57..ea45f9b 100644 --- a/6515/libsensors_iio/MPLSensor.h +++ b/6515/libsensors_iio/MPLSensor.h @@ -376,6 +376,7 @@ protected: InputEventCircularReader mAccelInputReader; InputEventCircularReader mGyroInputReader; + int mCompassOverFlow; bool mFirstRead; short mTempScale; short mTempOffset; |