diff options
author | Furquan Shaikh <furquan@google.com> | 2018-11-25 17:48:19 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-29 04:31:50 -0800 |
commit | ba1f417b824cae748474a3a210d75f109f8a8473 (patch) | |
tree | 28ed16968d93ccae30ff894dff85c664af1553de /common/motion_lid.c | |
parent | f3c205e9b4bcd391c7eeb633e424f06c20aed99e (diff) | |
download | chrome-ec-ba1f417b824cae748474a3a210d75f109f8a8473.tar.gz |
motion_lid: Set tablet mode at 180 degree
This change aligns tablet mode detection in EC to match the behavior
of Chrome. When lid angle goes beyond 200 degree, tablet mode is set
to 1. On the other hand, tablet mode is set to 0 when lid angle goes
below 160 degree.
BUG=b:120050761
BRANCH=None
TEST=make -j buildall. Verified that EC reports tablet mode close to 180
degrees.
Change-Id: If20a8e7545683b2a01f401f7db8d7973e70deb14
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1350472
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/motion_lid.c')
-rw-r--r-- | common/motion_lid.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/common/motion_lid.c b/common/motion_lid.c index 8d150e3b65..d737046c53 100644 --- a/common/motion_lid.c +++ b/common/motion_lid.c @@ -135,18 +135,18 @@ __attribute__((weak)) int board_is_lid_angle_tablet_mode(void) * - when lid is closed while the hinge is perpendicular to the floor, we will * stay in tablet mode. * - * Tablet mode is defined as the base being behind the lid. We use 2 threshold - * to calculate tablet mode: + * Tablet mode is defined as the lid angle being greater than 180 degree. We use + * 2 threshold to calculate tablet mode: * tablet_mode: - * 1 | +-----<----+---------- - * | \/ /\ - * | | | - * 0 |------------------------>----+ - * +------------------+----------+----------+ lid angle - * 0 240 300 360 + * 1 | +-----<----+---------- + * | \/ /\ + * | | | + * 0 |------------------>----+ + * +------------+----------+----------+ lid angle + * 0 160 200 360 */ -#define TABLET_ZONE_LID_ANGLE FLOAT_TO_FP(300) -#define LAPTOP_ZONE_LID_ANGLE FLOAT_TO_FP(240) +#define TABLET_ZONE_LID_ANGLE FLOAT_TO_FP(200) +#define LAPTOP_ZONE_LID_ANGLE FLOAT_TO_FP(160) /* * We will change our tablet mode status when we are "convinced" that it has |