From d20da59f1e5e52e49b858ef1d1d706342753853d Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Tue, 16 Apr 2019 14:18:08 +0800 Subject: bloog: correct accelerometer orientation Correct accelerometer orientation, because differece from meep. BUG=b:130619474 BRANCH=octopus TEST=When device is laying on a table, lid angle at 180, both sensors report gravity along Z axis: ectool motionsense Motion sensing active Sensor 0: 507 606 16748 Sensor 1: 17 -334 16442 Sensor 2: 0 0 0 Sensor 3: 0 0 0 When on the base bottom edge, report gravity along Y axis: ectool motionsense Motion sensing active Sensor 0: 403 16491 655 Sensor 1: 19 16163 1540 Sensor 2: 0 0 0 Sensor 3: 0 0 0 When on its left side, report gravity along X axis: ectool motionsense Motion sensing active Sensor 0: 16172 -374 1738 Sensor 1: 16315 -184 1280 Sensor 2: 0 0 0 Sensor 3: 0 0 0 and check the screen rotation was normally. Change-Id: I20ceab05ac9dce2cba09417a759d6657a185788d Signed-off-by: Devin Lu Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1569087 Reviewed-by: Justin TerAvest Reviewed-by: Diana Z Reviewed-by: Marco Chen Commit-Queue: Marco Chen (cherry picked from commit f194cdcce858682bc4328e01475db8d6e37e0de0) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1575045 Tested-by: Justin TerAvest Commit-Queue: Justin TerAvest --- board/bloog/board.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/board/bloog/board.c b/board/bloog/board.c index ea8b246e89..73bec21045 100644 --- a/board/bloog/board.c +++ b/board/bloog/board.c @@ -111,15 +111,15 @@ static struct mutex g_base_mutex; /* Matrix to rotate accelrator into standard reference frame */ const mat33_fp_t lid_standrd_ref = { - { FLOAT_TO_FP(1), 0, 0}, - { 0, FLOAT_TO_FP(-1), 0}, + { FLOAT_TO_FP(-1), 0, 0}, + { 0, FLOAT_TO_FP(1), 0}, { 0, 0, FLOAT_TO_FP(-1)} }; const mat33_fp_t base_standard_ref = { - { FLOAT_TO_FP(1), 0, 0}, + { FLOAT_TO_FP(-1), 0, 0}, { 0, FLOAT_TO_FP(-1), 0}, - { 0, 0, FLOAT_TO_FP(-1)} + { 0, 0, FLOAT_TO_FP(1)} }; /* sensor private data */ -- cgit v1.2.1