summaryrefslogtreecommitdiff
path: root/board/vilboz
diff options
context:
space:
mode:
authorLu Zhang <lu.zhang@bitland.corp-partner.google.com>2020-07-14 17:15:17 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-14 18:46:37 +0000
commitc6a84e237a69e04bbaa9cdac054894aac25b1b71 (patch)
treed72567cae25cd6fc0430b402b41edf065c6c2127 /board/vilboz
parentb8d45ce95bcbf29a5d587fc1febd72f9cef482da (diff)
downloadchrome-ec-c6a84e237a69e04bbaa9cdac054894aac25b1b71.tar.gz
vilboz: fix rotation matrix
BUG=b:161205155 BRANCH=none TEST=Using ec console 'accelinfo on' verified lid angle now goes from 0 to 360 and swtiches to tablet mode after crossing 180 threshold. Signed-off-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I1a0fcf524788bb72f739caec8c8d6e90f252b4c0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2297065 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'board/vilboz')
-rw-r--r--board/vilboz/board.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/board/vilboz/board.c b/board/vilboz/board.c
index 7741419fbc..bbfbcc1e5f 100644
--- a/board/vilboz/board.c
+++ b/board/vilboz/board.c
@@ -62,6 +62,12 @@ static const mat33_fp_t base_standard_ref = {
{ 0, 0, FLOAT_TO_FP(1)}
};
+static const mat33_fp_t lid_standard_ref = {
+ { FLOAT_TO_FP(1), 0, 0},
+ { 0, FLOAT_TO_FP(-1), 0},
+ { 0, 0, FLOAT_TO_FP(-1)}
+};
+
/* TODO(gcc >= 5.0) Remove the casts to const pointer at rot_standard_ref */
struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
@@ -75,7 +81,7 @@ struct motion_sensor_t motion_sensors[] = {
.drv_data = &g_lis2dwl_data,
.port = I2C_PORT_SENSOR,
.i2c_spi_addr_flags = LIS2DWL_ADDR1_FLAGS,
- .rot_standard_ref = NULL,
+ .rot_standard_ref = &lid_standard_ref,
.default_range = 2, /* g, enough for laptop. */
.min_frequency = LIS2DW12_ODR_MIN_VAL,
.max_frequency = LIS2DW12_ODR_MAX_VAL,