From 96166083de656dfb05c063d4707739cb2665f5a2 Mon Sep 17 00:00:00 2001 From: Adriana Reus Date: Wed, 26 Nov 2014 12:45:28 +0200 Subject: [PATCH] Remove accel special case for managing timestamps Change-Id: I966919ccae5144850279736af16df471bc1b38f2 Signed-off-by: Adriana Reus --- control.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/control.c b/control.c index 6701f68..75f2824 100644 --- a/control.c +++ b/control.c @@ -806,11 +806,10 @@ static void enable_motion_trigger (int dev_num) */ #define THRESHOLD 1.10 #define MAX_DELAY 500000000 /* 500 ms */ + void set_report_ts(int s, int64_t ts) { int64_t maxTs, period; - int catalog_index = sensor_info[s].catalog_index; - int is_accel = (sensor_catalog[catalog_index].type == SENSOR_TYPE_ACCELEROMETER); /* * A bit of a hack to please a bunch of cts tests. They @@ -823,7 +822,7 @@ void set_report_ts(int s, int64_t ts) REPORTING_MODE(sensor_desc[s].flags) == SENSOR_FLAG_CONTINUOUS_MODE) { period = (int64_t) (1000000000LL / sensor_info[s].sampling_rate); - maxTs = sensor_info[s].report_ts + (is_accel ? 1 : THRESHOLD) * period; + maxTs = sensor_info[s].report_ts + THRESHOLD * period; /* If we're too far behind get back on track */ if (ts - maxTs >= MAX_DELAY) maxTs = ts; -- 2.11.0