diff options
author | Alec Berg <alecaberg@chromium.org> | 2015-09-17 11:42:43 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-17 19:00:53 -0700 |
commit | 5717b3150c8a8d43e07ce2dc8065c3515d3651f7 (patch) | |
tree | b908d7a6bed31be5e5c06661bab52356b4d2b5da /test | |
parent | e686e95e9e2f50380862a9f95c0bba02d237b646 (diff) | |
download | chrome-ec-5717b3150c8a8d43e07ce2dc8065c3515d3651f7.tar.gz |
motion: add config option to use the old accelerometer ref frame
Add config option to use the old accelerometer reference frame,
which is used on samus and products using 3.14 or earlier kernel.
This fixes samus so that the lid angle calculation is correct
again.
This also moves the accel_orientation structure out of the board
directory and into common code, since it purely is a function of
the reference frame being used.
BUG=chrome-os-partner:43494
BRANCH=none
TEST=test on samus, verify lid angle calculation is correct once
again. also, enable the motion_lid test and verify that it passes.
Change-Id: I948a74a71964b54c68be66e828a030ddd0418947
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/300510
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/motion_lid.c | 4 | ||||
-rw-r--r-- | test/test_config.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c index 964bd9f026..ff97662843 100644 --- a/test/motion_lid.c +++ b/test/motion_lid.c @@ -29,7 +29,7 @@ /* * Time in ms to wait for the task to read the vectors. */ -#define TEST_LID_SLEEP_RATE (TEST_LID_EC_RATE / (5 * MSEC)) +#define TEST_LID_SLEEP_RATE (TEST_LID_EC_RATE / 5) /*****************************************************************************/ /* Mock functions */ @@ -184,7 +184,7 @@ 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/MSEC); + msleep(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); diff --git a/test/test_config.h b/test/test_config.h index a44573f82c..f758d87410 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -40,6 +40,7 @@ #endif #ifdef TEST_MOTION_LID +#define CONFIG_ACCEL_STD_REF_FRAME_OLD #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_SENSOR_BASE 0 #define CONFIG_LID_ANGLE_SENSOR_LID 1 |