diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-09-08 11:51:25 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-29 19:38:21 -0700 |
commit | d0e1c2394c641afdbd633e9393131fe03fdefa9f (patch) | |
tree | a2561e8865a92ec480e90ba25d88a5491d57b999 /test | |
parent | 1092919c51101cdbee266f21a493d95c7f0cd77c (diff) | |
download | chrome-ec-d0e1c2394c641afdbd633e9393131fe03fdefa9f.tar.gz |
common: motion: Separate motion task interval from AP configuration
Some sensors are in forced mode, motion sense must be scheduled at
their ODR. However the host may not want the data right away,
so motion task may not wake up the host that often.
Add a new variable motion_int_interval that defines the maximum interval
between FIFO host event.
BRANCH=smaug
BUG=chrome-os-partner:43800
TEST=Check that light sensor is polled at ODR frequency.
Check that when AP does not want any event, no FIFO host event are
requested.
Check CTS tests work as before.
Reenable motion_lid unit test.
Change-Id: Ie25e6cbe28fed899073856057855ffa03c0cd9fd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/301134
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/motion_lid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c index ff97662843..ba6a179b1c 100644 --- a/test/motion_lid.c +++ b/test/motion_lid.c @@ -164,7 +164,7 @@ struct motion_sensor_t motion_sensors[] = { }, /* Used for double tap */ [SENSOR_CONFIG_EC_S3] = { - .odr = 119000 | ROUND_UP_FLAG, + .odr = 200000 | ROUND_UP_FLAG, .ec_rate = TEST_LID_EC_RATE * 100, }, [SENSOR_CONFIG_EC_S5] = { @@ -199,14 +199,14 @@ static int test_lid_angle(void) /* Go to S3 state */ TEST_ASSERT(sensor_active == SENSOR_ACTIVE_S5); TEST_ASSERT(accel_get_data_rate(lid) == 0); - TEST_ASSERT(accel_interval == 0); + TEST_ASSERT(motion_interval == 0); /* Go to S0 state */ hook_notify(HOOK_CHIPSET_RESUME); msleep(1000); TEST_ASSERT(sensor_active == SENSOR_ACTIVE_S0); TEST_ASSERT(accel_get_data_rate(lid) == (119000 | ROUND_UP_FLAG)); - TEST_ASSERT(accel_interval == TEST_LID_EC_RATE * MSEC); + TEST_ASSERT(motion_interval == TEST_LID_EC_RATE * MSEC); /* * Set the base accelerometer as if it were sitting flat on a desk |