mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
oak: set up base accelerometer rotation matrix
The base accelerometer on oak rev5 needs to be rotated 180 degrees
along the z-axis to match the standard reference frame.
BUG=chrome-os-partner:50312
BRANCH=none
TEST=manually rotate my oak rev5 and verify that `ectool motionsense`
reports correct accelerometer readings
Change-Id: I05a377b5f0827e2aad47d388dc3264d451580989
Signed-off-by: Ricky Liang <jcliang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/330484
Reviewed-by: Rong Chang <rongchang@chromium.org>
This commit is contained in:
@@ -646,6 +646,13 @@ static struct mutex g_lid_mutex;
|
||||
#endif
|
||||
#ifdef CONFIG_ACCELGYRO_BMI160
|
||||
static struct mutex g_base_mutex;
|
||||
|
||||
/* Matrix to rotate accelrator into standard reference frame */
|
||||
const matrix_3x3_t base_standard_ref = {
|
||||
{ FLOAT_TO_FP(-1), 0, 0},
|
||||
{ 0, FLOAT_TO_FP(-1), 0},
|
||||
{ 0, 0, FLOAT_TO_FP(1)}
|
||||
};
|
||||
#endif
|
||||
|
||||
/* KX022 private data */
|
||||
@@ -669,7 +676,7 @@ struct motion_sensor_t motion_sensors[] = {
|
||||
.mutex = &g_base_mutex,
|
||||
.drv_data = &g_bmi160_data,
|
||||
.addr = 1,
|
||||
.rot_standard_ref = NULL, /* Identity matrix. */
|
||||
.rot_standard_ref = &base_standard_ref,
|
||||
.default_range = 2, /* g, enough for laptop. */
|
||||
.config = {
|
||||
/* AP: by default use EC settings */
|
||||
|
||||
Reference in New Issue
Block a user