summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-11-17 13:05:58 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-18 13:33:27 -0800
commit420099f74976b3af1f4b24dc24b9fec461b1037b (patch)
treeed28845a84cccfd5083902c5a12b36b4bb015247 /test
parent192d0b4da107aa65c3e340e883034811601cbe17 (diff)
downloadchrome-ec-420099f74976b3af1f4b24dc24b9fec461b1037b.tar.gz
motion: Change units of ec_rate from us to ms.
To ease finer calculation of ec rate change units from ms to us. BRANCH=smaug BUG=b:24367625 TEST=compile Change-Id: I52057c8ca1b1180a64b58d1ba0af9ec53f40b026 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/312984
Diffstat (limited to 'test')
-rw-r--r--test/motion_lid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c
index 5fdd26b7fd..224b12a26b 100644
--- a/test/motion_lid.c
+++ b/test/motion_lid.c
@@ -26,7 +26,7 @@ extern unsigned motion_interval;
* Period in us for the motion task period.
* The task will read the vectors at that interval
*/
-#define TEST_LID_EC_RATE (10)
+#define TEST_LID_EC_RATE (10 * MSEC)
/*
* Time in ms to wait for the task to read the vectors.
@@ -186,10 +186,10 @@ static void wait_for_valid_sample(void)
uint8_t *lpc_status = host_get_memmap(EC_MEMMAP_ACC_STATUS);
sample = *lpc_status & EC_MEMMAP_ACC_STATUS_SAMPLE_ID_MASK;
- msleep(TEST_LID_EC_RATE);
+ usleep(TEST_LID_EC_RATE);
task_wake(TASK_ID_MOTIONSENSE);
while ((*lpc_status & EC_MEMMAP_ACC_STATUS_SAMPLE_ID_MASK) == sample)
- msleep(TEST_LID_SLEEP_RATE);
+ usleep(TEST_LID_SLEEP_RATE);
}
static int test_lid_angle(void)
@@ -210,7 +210,7 @@ static int test_lid_angle(void)
msleep(1000);
TEST_ASSERT(sensor_active == SENSOR_ACTIVE_S0);
TEST_ASSERT(accel_get_data_rate(lid) == (119000 | ROUND_UP_FLAG));
- TEST_ASSERT(motion_interval == TEST_LID_EC_RATE * MSEC);
+ TEST_ASSERT(motion_interval == TEST_LID_EC_RATE);
/*
* Set the base accelerometer as if it were sitting flat on a desk