Lines Matching refs:timestamp

394 /** Get last timestamp across all 3 sensors that are on.
395 * This find out which timestamp has the largest value for sensors that are on.
400 inv_time_t timestamp = 0;
402 timestamp = sensors.accel.timestamp;
405 if (timestamp < sensors.gyro.timestamp) {
406 timestamp = sensors.gyro.timestamp;
408 MPL_LOGV("g ts: %lld", timestamp);
411 if (timestamp < sensors.compass.timestamp) {
412 timestamp = sensors.compass.timestamp;
416 if (timestamp < sensors.temp.timestamp)
417 timestamp = sensors.temp.timestamp;
420 if (timestamp < sensors.quat.timestamp)
421 timestamp = sensors.quat.timestamp;
422 MPL_LOGV("q ts: %lld", timestamp);
425 return timestamp;
777 * @param[in] timestamp
781 inv_error_t inv_build_accel(const long *accel, int status, inv_time_t timestamp)
788 fwrite(&timestamp, sizeof(timestamp), 1, inv_data_builder.file);
807 sensors.accel.timestamp_prev = sensors.accel.timestamp;
808 sensors.accel.timestamp = timestamp;
816 * @param[in] timestamp Monotonic time stamp, for Android it's in nanoseconds.
820 inv_error_t inv_build_gyro(const short *gyro, inv_time_t timestamp)
827 fwrite(&timestamp, sizeof(timestamp), 1, inv_data_builder.file);
833 sensors.gyro.timestamp_prev = sensors.gyro.timestamp;
834 sensors.gyro.timestamp = timestamp;
847 * @param[in] timestamp Monotonic time stamp, for Android it's in nanoseconds.
852 inv_time_t timestamp)
859 fwrite(&timestamp, sizeof(timestamp), 1, inv_data_builder.file);
880 sensors.compass.timestamp_prev = sensors.compass.timestamp;
881 sensors.compass.timestamp = timestamp;
889 * @param[in] timestamp Monotonic time stamp; for Android it's in
893 inv_error_t inv_build_temp(const long temp, inv_time_t timestamp)
900 fwrite(&timestamp, sizeof(timestamp), 1, inv_data_builder.file);
905 sensors.temp.timestamp_prev = sensors.temp.timestamp;
906 sensors.temp.timestamp = timestamp;
918 * @param[in] timestamp
919 * @param[in] timestamp Monotonic time stamp; for Android it's in
924 inv_error_t inv_build_quat(const long *quat, int status, inv_time_t timestamp)
931 fwrite(&timestamp, sizeof(timestamp), 1, inv_data_builder.file);
945 sensors.quat.timestamp = timestamp;
955 inv_store_gaming_quaternion(quat, timestamp);
959 inv_set_compass_correction(identity, timestamp);
964 inv_error_t inv_build_pressure(const long pressure, int status, inv_time_t timestamp)
1179 current_time = sensors.gyro.timestamp;
1183 current_time = MAX(current_time, sensors.accel.timestamp);
1187 current_time = MAX(current_time, sensors.compass.timestamp);
1191 current_time = MAX(current_time, sensors.temp.timestamp);
1195 current_time = MAX(current_time, sensors.quat.timestamp);
1202 if (inv_delta_time_ms(current_time, sensors.gyro.timestamp) >= 2000)
1204 if (inv_delta_time_ms(current_time, sensors.accel.timestamp) >= 2000)
1206 if (inv_delta_time_ms(current_time, sensors.compass.timestamp) >= 2000)
1209 if (inv_delta_time_ms(current_time, sensors.temp.timestamp) >= 2000)
1222 /** Gets a whole set of accel data including data, accuracy and timestamp.
1225 * @param[out] timestamp The timestamp of the data sample.
1227 void inv_get_accel_set(long *data, int8_t *accuracy, inv_time_t *timestamp)
1232 if (timestamp != NULL) {
1233 *timestamp = sensors.accel.timestamp;
1240 /** Gets a whole set of gyro data including data, accuracy and timestamp.
1243 * @param[out] timestamp The timestamp of the data sample.
1245 void inv_get_gyro_set(long *data, int8_t *accuracy, inv_time_t *timestamp)
1248 if (timestamp != NULL) {
1249 *timestamp = sensors.gyro.timestamp;
1256 /** Gets a whole set of gyro raw data including data, accuracy and timestamp.
1259 * @param[out] timestamp The timestamp of the data sample.
1261 void inv_get_gyro_set_raw(long *data, int8_t *accuracy, inv_time_t *timestamp)
1264 if (timestamp != NULL) {
1265 *timestamp = sensors.gyro.timestamp;
1280 /** Gets a whole set of compass data including data, accuracy and timestamp.
1283 * @param[out] timestamp The timestamp of the data sample.
1285 void inv_get_compass_set(long *data, int8_t *accuracy, inv_time_t *timestamp)
1288 if (timestamp != NULL) {
1289 *timestamp = sensors.compass.timestamp;
1299 /** Gets a whole set of compass raw data including data, accuracy and timestamp.
1302 * @param[out] timestamp The timestamp of the data sample.
1304 void inv_get_compass_set_raw(long *data, int8_t *accuracy, inv_time_t *timestamp)
1307 if (timestamp != NULL) {
1308 *timestamp = sensors.compass.timestamp;
1314 /** Gets a whole set of temperature data including data, accuracy and timestamp.
1317 * @param[out] timestamp The timestamp of the data sample.
1319 void inv_get_temp_set(long *data, int *accuracy, inv_time_t *timestamp)
1322 if (timestamp)
1323 *timestamp = sensors.temp.timestamp;