summaryrefslogtreecommitdiff
path: root/test/motion_lid.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/motion_lid.c')
-rw-r--r--test/motion_lid.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/motion_lid.c b/test/motion_lid.c
index dfea3ecf91..bed03379ff 100644
--- a/test/motion_lid.c
+++ b/test/motion_lid.c
@@ -316,6 +316,20 @@ static int test_lid_angle(void)
wait_for_valid_sample();
TEST_ASSERT(motion_lid_get_angle() == LID_ANGLE_UNRELIABLE);
+ /*
+ * Open the lid to 350, and then close the lid and set the angle
+ * to 10. The reading of small angle shouldn't be corrected.
+ */
+ gpio_set_level(GPIO_LID_OPEN, 1);
+ msleep(100);
+ gpio_set_level(GPIO_LID_OPEN, 0);
+ msleep(100);
+ lid->xyz[X] = 0;
+ lid->xyz[Y] = 173;
+ lid->xyz[Z] = -984;
+ wait_for_valid_sample();
+ TEST_ASSERT(motion_lid_get_angle() == 10);
+
return EC_SUCCESS;
}