summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/cyan/board.c4
-rw-r--r--common/motion_lid.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/board/cyan/board.c b/board/cyan/board.c
index 568c32e765..d77dbeb45c 100644
--- a/board/cyan/board.c
+++ b/board/cyan/board.c
@@ -111,8 +111,8 @@ 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)}
+ { 0, FLOAT_TO_FP(1), 0},
+ { 0, 0, FLOAT_TO_FP(-1)}
};
struct motion_sensor_t motion_sensors[] = {
diff --git a/common/motion_lid.c b/common/motion_lid.c
index eca904f900..32fea49e18 100644
--- a/common/motion_lid.c
+++ b/common/motion_lid.c
@@ -147,10 +147,14 @@ int motion_lid_get_angle(void)
*/
void motion_lid_calc(void)
{
+ /* rotate lid vector by 180 degre to be in the right coordinate frame */
+ vector_3_t lid = { accel_lid->xyz[X],
+ accel_lid->xyz[Y] * -1,
+ accel_lid->xyz[Z] * -1};
+
/* Calculate angle of lid accel. */
lid_angle_is_reliable = calculate_lid_angle(
- accel_base->xyz,
- accel_lid->xyz,
+ accel_base->xyz, lid,
&lid_angle_deg);
#ifdef CONFIG_LID_ANGLE_UPDATE