summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Zhou <zhouguohui@huaqin.corp-partner.google.com>2020-10-22 22:45:29 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-23 05:16:41 +0000
commit2001c472277570c81826c1d0a8e5d72650160a1b (patch)
tree643b9adb430510c4531c28444ca921108be67f61
parentce87da13c5d147506f967d4d4dd72b19eeeb78ac (diff)
downloadchrome-ec-2001c472277570c81826c1d0a8e5d72650160a1b.tar.gz
Coachz: initial g-sensor support
update lid accel matrixes modify motion_sensors data struct BUG=b:170288119 TEST=make BOARD=coachz -j flash ec and ectool motionsense return values BRANCH=master Change-Id: Ida746f6885007f7e396953eef9254879a0ee2963 Signed-off-by: Simon Zhou <zhouguohui@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492180 Reviewed-by: Wai-Hong Tam <waihong@google.com>
-rw-r--r--board/coachz/board.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/board/coachz/board.c b/board/coachz/board.c
index 62c13f5b71..57f3cccc73 100644
--- a/board/coachz/board.c
+++ b/board/coachz/board.c
@@ -244,9 +244,9 @@ static struct bmi_drv_data_t g_bmi160_data;
/* Matrix to rotate accelerometer into standard reference frame */
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)}
+ { 0, FLOAT_TO_FP(1), 0},
+ { FLOAT_TO_FP(-1), 0, 0},
+ { 0, 0, FLOAT_TO_FP(1)}
};
struct motion_sensor_t motion_sensors[] = {
@@ -260,7 +260,7 @@ struct motion_sensor_t motion_sensors[] = {
.active_mask = SENSOR_ACTIVE_S0_S3_S5,
.chip = MOTIONSENSE_CHIP_BMI160,
.type = MOTIONSENSE_TYPE_ACCEL,
- .location = MOTIONSENSE_LOC_BASE,
+ .location = MOTIONSENSE_LOC_LID,
.drv = &bmi160_drv,
.mutex = &g_lid_mutex,
.drv_data = &g_bmi160_data,
@@ -281,7 +281,7 @@ struct motion_sensor_t motion_sensors[] = {
.active_mask = SENSOR_ACTIVE_S0_S3_S5,
.chip = MOTIONSENSE_CHIP_BMI160,
.type = MOTIONSENSE_TYPE_GYRO,
- .location = MOTIONSENSE_LOC_BASE,
+ .location = MOTIONSENSE_LOC_LID,
.drv = &bmi160_drv,
.mutex = &g_lid_mutex,
.drv_data = &g_bmi160_data,
@@ -301,6 +301,7 @@ static void board_init(void)
/* Enable BC1.2 interrupts */
gpio_enable_interrupt(GPIO_USB_C0_BC12_INT_L);
gpio_enable_interrupt(GPIO_USB_C1_BC12_INT_L);
+ gpio_enable_interrupt(GPIO_ACCEL_GYRO_INT_L);
/*
* The H1 SBU line for CCD are behind PPC chip. The PPC internal FETs