aboutsummaryrefslogtreecommitdiff
path: root/apps/sensor_world
diff options
context:
space:
mode:
authorMeng-hsuan Chung <menghsuan@google.com>2017-11-16 10:46:24 -0800
committerMeng-hsuan Chung <menghsuan@google.com>2017-11-27 15:55:52 -0800
commit5e111a4121ba970f6ca14a9369820225f1552818 (patch)
treef3495ea1fd1b2f98e2befd9787af32b392d70635 /apps/sensor_world
parenta6701763f8609b9aeb7752c1b526122b2023ddad (diff)
downloadchre-5e111a4121ba970f6ca14a9369820225f1552818.tar.gz
Adds support for QC SEE continuous sensors
These include uncal accel, unacl gyro, uncal mag and pressure sensors. Accel/gyro/mag and temperature sensors will be added later. Bug: 68046206 Test: ./load_chre.sh and run SensorWorld Change-Id: I738b8290b19ef998339c64923de1a06632b6bb73
Diffstat (limited to 'apps/sensor_world')
-rw-r--r--apps/sensor_world/sensor_world.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/sensor_world/sensor_world.cc b/apps/sensor_world/sensor_world.cc
index 6e672b9b..e7a9a49a 100644
--- a/apps/sensor_world/sensor_world.cc
+++ b/apps/sensor_world/sensor_world.cc
@@ -203,15 +203,18 @@ void nanoappHandleEvent(uint32_t senderInstanceId,
y /= header.readingCount;
z /= header.readingCount;
- LOGI("%s, %d samples: %f %f %f",
- getSensorNameForEventType(eventType), header.readingCount, x, y, z);
+ LOGI("%s, %d samples: %f %f %f, t=%" PRIu64 " ms",
+ getSensorNameForEventType(eventType), header.readingCount, x, y, z,
+ header.baseTimestamp / kOneMillisecondInNanoseconds);
if (eventType == CHRE_EVENT_SENSOR_UNCALIBRATED_GYROSCOPE_DATA) {
LOGI("UncalGyro time: first %" PRIu64 " last %" PRIu64 " chre %" PRIu64
" delta [%" PRId64 ", %" PRId64 "]ms",
header.baseTimestamp, sampleTime, chreTime,
- static_cast<int64_t>(header.baseTimestamp - chreTime) / 1000000,
- static_cast<int64_t>(sampleTime - chreTime) / 1000000);
+ static_cast<int64_t>(header.baseTimestamp - chreTime)
+ / kOneMillisecondInNanoseconds,
+ static_cast<int64_t>(sampleTime - chreTime)
+ / kOneMillisecondInNanoseconds);
}
break;
}