summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTino Liu <tino.liu@quanta.corp-partner.google.com>2018-10-29 13:27:35 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-01 02:17:53 -0700
commitbaa1a474a387022ef5727592e0a6eb0ff6985253 (patch)
treec7e8878fab0a2901f0073642f6336d3fe4866e1a
parent34ea5969dd36815de20abbf9ce27fc1583564533 (diff)
downloadchrome-ec-baa1a474a387022ef5727592e0a6eb0ff6985253.tar.gz
Bobba: Modify base accel/gyro rotation for SKU with AR Cam.
Sparky360 with SKU ID 26 has AR Cam, and move base accel/gryo to AR Cam board. AR Cam board has about -16 bias with motherboard through Y axis. Modify base accel/gyro rotation reference for SKU with AR Cam. BUG=b:118646061 BRANCH=none TEST=compile pass, `ectool motionsense lid_angle` shows correct, factory testing ScreenRotation & TabletRotationBaseAccel test passed Change-Id: Ie2c2d2faa9cd562f5807eb31b1fc92f3fc792e74 Signed-off-by: Tino Liu <tino.liu@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1304156 Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r--board/bobba/board.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/board/bobba/board.c b/board/bobba/board.c
index 9bcfd777f5..5bb71f806f 100644
--- a/board/bobba/board.c
+++ b/board/bobba/board.c
@@ -141,6 +141,22 @@ const mat33_fp_t base_standard_ref = {
{ 0, 0, FLOAT_TO_FP(1)}
};
+/*
+ * Sparky360 SKU ID 26 has AR Cam, and move base accel/gryo to AR Cam board.
+ * AR Cam board has about -16° bias with motherboard through Y axis.
+ * Rotation matrix with -16° through Y axis:
+ * | cos(-16°) 0 sin(-16°)|
+ * R = | 0 1 0 |
+ * |-sin(-16°) 0 cos(-16°)|
+ *
+ * base_ar_cam_ref = R * base_standard_ref
+ */
+const mat33_fp_t base_ar_cam_ref = {
+ { 0, FLOAT_TO_FP(-0.96126), FLOAT_TO_FP(0.27564)},
+ { FLOAT_TO_FP(1), 0, 0},
+ { 0, FLOAT_TO_FP(0.27564), FLOAT_TO_FP(0.96126)}
+};
+
/* sensor private data */
static struct kionix_accel_data g_kx022_data;
static struct bmi160_drv_data_t g_bmi160_data;
@@ -237,6 +253,12 @@ static int board_is_convertible(void)
|| sku_id == 25 || sku_id == 26 || sku_id == 255;
}
+static int board_with_ar_cam(void)
+{
+ /* SKU ID of Sparky360 with AR Cam: 26 */
+ return sku_id == 26;
+}
+
static void board_update_sensor_config_from_sku(void)
{
if (board_is_convertible()) {
@@ -245,6 +267,12 @@ static void board_update_sensor_config_from_sku(void)
motion_sensor_count = 0;
tablet_disable_switch();
}
+
+ /* Sparky360 with AR Cam: base accel/gyro sensor is on AR Cam board. */
+ if (board_with_ar_cam()) {
+ motion_sensors[BASE_ACCEL].rot_standard_ref = &base_ar_cam_ref;
+ motion_sensors[BASE_GYRO].rot_standard_ref = &base_ar_cam_ref;
+ }
}
/* Read CBI from i2c eeprom and initialize variables for board variants */