From 29e9992a97b9fe96ae58a3a747fad0b0c2851314 Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Thu, 17 Oct 2019 09:48:04 +0800 Subject: dratini: correct accel orientation BUG=none BRANCH=none TEST=When device is laying on a table, lid angle at 180, both sensors report gravity along Z axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -1040 4336 15408 Sensor 1: 760 -291 17127 Sensor 2: 0 0 0 When on the base bottom edge, report gravity along Y axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -960 14112 -5952 Sensor 1: 453 16136 -373 Sensor 2: 0 0 0 When on its left side, report gravity along X axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: 16352 -432 64 Sensor 1: 16802 -338 192 Sensor 2: 0 0 0 and check the screen rotation was normally. Change-Id: Idbe7184d5c14eb31d7823f9e17648d9bf3df4443 Signed-off-by: Devin Lu Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866209 Reviewed-by: Paul Fagerburg Reviewed-by: Tim Wawrzynczak --- board/dratini/board.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/board/dratini/board.c b/board/dratini/board.c index f6fe06cdbc..199d9bd7ec 100644 --- a/board/dratini/board.c +++ b/board/dratini/board.c @@ -182,19 +182,14 @@ static struct accelgyro_saved_data_t g_bma255_data; /* Matrix to rotate accelrator into standard reference frame */ static const mat33_fp_t base_standard_ref = { - { 0, FLOAT_TO_FP(1), 0}, { FLOAT_TO_FP(-1), 0, 0}, + { 0, FLOAT_TO_FP(-1), 0}, { 0, 0, FLOAT_TO_FP(1)} }; -/* - * TODO(b/124337208): P0 boards don't have this sensor mounted so the rotation - * matrix can't be tested properly. This needs to be revisited after EVT to make - * sure the rotaiton matrix for the lid sensor is correct. - */ static const mat33_fp_t lid_standard_ref = { + { FLOAT_TO_FP(1), 0, 0}, { 0, FLOAT_TO_FP(-1), 0}, - { FLOAT_TO_FP(-1), 0, 0}, { 0, 0, FLOAT_TO_FP(-1)} }; -- cgit v1.2.1