summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-04-08 10:28:29 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-04-11 04:00:44 +0000
commiteaa645e0cc092fbaaa1a81ed5308831e71ebf86c (patch)
treeebf92cd466682ee38fc2d0f5caa801d6e8a3d431 /test
parent335ad0c397f61d81d7fb5db8e3fb24e9bc089a2d (diff)
downloadchrome-ec-eaa645e0cc092fbaaa1a81ed5308831e71ebf86c.tar.gz
accel: Add host cmd for setting lid angle threshold for disabling keyboard wake
Added a sub-command to the motionsense host command (0x2b) for getting/setting the lid angle at which the keyboard is disabled as a wake source in S3. The value can be anywhere from 0 to 360 degrees, default set to 180. Note, this only takes affect for boards that have CONFIG_LID_ANGLE_KEY_SCAN defined. Modified ectool motionsense command to use new host sub-command. Also modified the lid angle measurement in the EC to be in the range [0, 360], instead of [-180, 180], and changed casting of lid angle as an int to round to nearest. BUG=none BRANCH=rambi TEST=Tested on a glimmer: Using default keyboard disable lid angle of 180, made sure that when lid angle is past 180, key presses do not wake system, and when lid angle is less than 180, key presses do wake up system. Used ectool motionsense kb_wake to set the keyboard disable lid angle to 0. Made sure that keyboard never wakes up the system. Set keyboard disable lid angle to 360 and made sure that the keyboard always wakes up the system. Change-Id: I437164c6e38c29169ef6e20e86c9cf2a1c78f86e Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/193663 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/194172
Diffstat (limited to 'test')
-rw-r--r--test/motion_sense.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/motion_sense.c b/test/motion_sense.c
index ab07a41e96..1ec3d4ad60 100644
--- a/test/motion_sense.c
+++ b/test/motion_sense.c
@@ -86,13 +86,13 @@ static int test_lid_angle(void)
msleep(5);
TEST_ASSERT(motion_get_lid_angle() == 90);
- /* Set lid open to -135. */
+ /* Set lid open to 225. */
mock_x_acc[ACCEL_LID] = 500;
mock_y_acc[ACCEL_LID] = 0;
mock_z_acc[ACCEL_LID] = -500;
task_wake(TASK_ID_MOTIONSENSE);
msleep(5);
- TEST_ASSERT(motion_get_lid_angle() == -135);
+ TEST_ASSERT(motion_get_lid_angle() == 225);
/*
* Align base with hinge and make sure it returns unreliable for angle.