summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--6515/libsensors_iio/MPLSensor.cpp15
-rwxr-xr-x6515/libsensors_iio/SensorBase.cpp2
2 files changed, 9 insertions, 8 deletions
diff --git a/6515/libsensors_iio/MPLSensor.cpp b/6515/libsensors_iio/MPLSensor.cpp
index 054303e..0ef2c95 100644
--- a/6515/libsensors_iio/MPLSensor.cpp
+++ b/6515/libsensors_iio/MPLSensor.cpp
@@ -1821,7 +1821,7 @@ int MPLSensor::enableDmpPedometer(int en, int interruptMode)
mFeatureActiveMask |= INV_DMP_PEDOMETER_STEP;
}
- clock_gettime(CLOCK_MONOTONIC, &mt_pre);
+ clock_gettime(CLOCK_BOOTTIME, &mt_pre);
} else {
if (interruptMode) {
mFeatureActiveMask &= ~INV_DMP_PEDOMETER;
@@ -2826,7 +2826,7 @@ int MPLSensor::smHandler(sensors_event_t* s)
/* Capture timestamp in HAL */
struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
+ clock_gettime(CLOCK_BOOTTIME, &ts);
s->timestamp = (int64_t) ts.tv_sec * 1000000000 + ts.tv_nsec;
LOGV_IF(HANDLER_DATA, "HAL:sm data: %f - %lld - %d",
@@ -2885,7 +2885,7 @@ int MPLSensor::sdHandler(sensors_event_t* s)
/* get current timestamp */
struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts) ;
+ clock_gettime(CLOCK_BOOTTIME, &ts) ;
s->timestamp = (int64_t)ts.tv_sec * 1000000000 + ts.tv_nsec;
LOGV_IF(HANDLER_DATA, "HAL:sd data: %f - %lld - %d",
@@ -2911,7 +2911,7 @@ int MPLSensor::scHandler(sensors_event_t* s)
if (s->timestamp == 0 && update) {
struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
+ clock_gettime(CLOCK_BOOTTIME, &ts);
s->timestamp = (int64_t) ts.tv_sec * 1000000000 + ts.tv_nsec;
// workaround for some platform which has gap between monotonic clock
// and Android SystemClock.
@@ -4694,7 +4694,7 @@ int MPLSensor::readDmpOrientEvents(sensors_event_t* data, int count)
temp.screen_orientation = screen_orientation;
#endif
struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
+ clock_gettime(CLOCK_BOOTTIME, &ts);
temp.timestamp = (int64_t) ts.tv_sec * 1000000000 + ts.tv_nsec;
*data++ = temp;
@@ -4766,7 +4766,7 @@ bool MPLSensor::hasStepCountPendingEvents(void)
struct timespec t_now;
int64_t interval = 0;
- clock_gettime(CLOCK_MONOTONIC, &t_now);
+ clock_gettime(CLOCK_BOOTTIME, &t_now);
interval = ((int64_t(t_now.tv_sec) * 1000000000LL + t_now.tv_nsec) -
(int64_t(mt_pre.tv_sec) * 1000000000LL + mt_pre.tv_nsec));
@@ -4776,7 +4776,7 @@ bool MPLSensor::hasStepCountPendingEvents(void)
interval, mStepCountPollTime);
return false;
} else {
- clock_gettime(CLOCK_MONOTONIC, &mt_pre);
+ clock_gettime(CLOCK_BOOTTIME, &mt_pre);
LOGV_IF(0, "Step Count previous time: %ld ms",
mt_pre.tv_nsec / 1000);
return true;
@@ -5223,6 +5223,7 @@ int MPLSensor::inv_init_sysfs_attributes(void)
// get proper (in absolute) IIO path & build MPU's sysfs paths
inv_get_sysfs_path(sysfs_path);
+ LOGV_IF(true, "njv Invensense sysfs path : %s", sysfs_path);
memcpy(mSysfsPath, sysfs_path, sizeof(sysfs_path));
sprintf(mpu.key, "%s%s", sysfs_path, "/key");
diff --git a/6515/libsensors_iio/SensorBase.cpp b/6515/libsensors_iio/SensorBase.cpp
index a2b38c3..16057ff 100755
--- a/6515/libsensors_iio/SensorBase.cpp
+++ b/6515/libsensors_iio/SensorBase.cpp
@@ -144,7 +144,7 @@ int64_t SensorBase::getTimestamp()
{
struct timespec t;
t.tv_sec = t.tv_nsec = 0;
- clock_gettime(CLOCK_MONOTONIC, &t);
+ clock_gettime(CLOCK_BOOTTIME, &t);
return int64_t(t.tv_sec) * 1000000000LL + t.tv_nsec;
}