From c9b7ffb5938a660ba36f0c67725032b3f05a42dd Mon Sep 17 00:00:00 2001 From: Kevin Cheng Date: Tue, 15 Sep 2015 14:37:53 +0800 Subject: strago: fix sensors matrices Matches definitons set in chromium/chromeos/accelerometer/accelerometer_types.h. Using that standard, the coordinate frames of the lid and base DO NOT line up perfectly when the lid is fully closed or fully open. Therefore, rotate the lid vector 180 along the X axis before calculating the lid angle. BRANCH=strago BUG=none TEST=When the device is open 180 degrees, check the sensors agree with each other: Flat on the back (Z pointing to the sky): localhost devices # cat */*raw -1008 [keyboard : X] -112 [keyboard : Y] 16544 [kyeboard : Z] -256 [lid : X ] 2000 [lid : Y ] 16336 [lid : Z ] On the right side (X pointing to the ground) localhost devices # cat */*raw -16928 -48 -1040 -16176 432 80 On the bottom edge (Y pointing to the sky) localhost devices # cat */*raw -192 15872 1648 496 15936 752 Check the angle as calculated by the EC is correct using accelinfo. Change-Id: I620b0078863137bc244aeacb6d8a81a9c869211a Signed-off-by: Kevin Cheng Reviewed-on: https://chromium-review.googlesource.com/299577 Reviewed-by: Shawn N --- board/strago/board.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/board/strago/board.c b/board/strago/board.c index 42ec939e28..b354b1a75f 100644 --- a/board/strago/board.c +++ b/board/strago/board.c @@ -127,9 +127,9 @@ const matrix_3x3_t base_standard_ref = { }; const matrix_3x3_t lid_standard_ref = { - {FLOAT_TO_FP(-1), 0, 0}, - { 0, FLOAT_TO_FP(-1), 0}, - { 0, 0, FLOAT_TO_FP(-1)} + {FLOAT_TO_FP(1), 0, 0}, + { 0, FLOAT_TO_FP(1), 0}, + { 0, 0, FLOAT_TO_FP(1)} }; struct motion_sensor_t motion_sensors[] = { -- cgit v1.2.1