diff options
Diffstat (limited to 'board/samus')
-rw-r--r-- | board/samus/board.c | 32 | ||||
-rw-r--r-- | board/samus/board.h | 5 |
2 files changed, 22 insertions, 15 deletions
diff --git a/board/samus/board.c b/board/samus/board.c index 08dae68780..e6682d4717 100644 --- a/board/samus/board.c +++ b/board/samus/board.c @@ -28,6 +28,7 @@ #include "lid_switch.h" #include "lightbar.h" #include "motion_sense.h" +#include "motion_lid.h" #include "peci.h" #include "power.h" #include "power_button.h" @@ -264,6 +265,19 @@ static struct mutex g_lid_mutex; struct kxcj9_data g_kxcj9_data; /* Four Motion sensors */ +/* Matrix to rotate accelrator into standard reference frame */ +const matrix_3x3_t base_standard_ref = { + {-1, 0, 0}, + { 0, -1, 0}, + { 0, 0, -1} +}; + +const matrix_3x3_t lid_standard_ref = { + { 0, 1, 0}, + {-1, 0, 0}, + { 0, 0, -1} +}; + struct motion_sensor_t motion_sensors[] = { /* @@ -274,30 +288,23 @@ struct motion_sensor_t motion_sensors[] = { {SENSOR_ACTIVE_S0_S3_S5, "Base", SENSOR_CHIP_LSM6DS0, SENSOR_ACCELEROMETER, LOCATION_BASE, &lsm6ds0_drv, &g_base_mutex, NULL, - LSM6DS0_ADDR1, 119000, 2}, + LSM6DS0_ADDR1, &base_standard_ref, 119000, 2}, {SENSOR_ACTIVE_S0, "Lid", SENSOR_CHIP_KXCJ9, SENSOR_ACCELEROMETER, LOCATION_LID, &kxcj9_drv, &g_lid_mutex, &g_kxcj9_data, - KXCJ9_ADDR0, 100000, 2}, + KXCJ9_ADDR0, &lid_standard_ref, 100000, 2}, {SENSOR_ACTIVE_S0, "Base Gyro", SENSOR_CHIP_LSM6DS0, SENSOR_GYRO, LOCATION_BASE, &lsm6ds0_drv, &g_base_mutex, NULL, - LSM6DS0_ADDR1, 119000, 2000}, + LSM6DS0_ADDR1, NULL, 119000, 2000}, }; const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); /* Define the accelerometer orientation matrices. */ const struct accel_orientation acc_orient = { - /* Lid and base sensor are already aligned. */ - .rot_align = { - { 0, -1, 0}, - { 1, 0, 0}, - { 0, 0, 1} - }, - /* Hinge aligns with y axis. */ .rot_hinge_90 = { { 1, 0, 0}, @@ -309,10 +316,5 @@ const struct accel_orientation acc_orient = { { 0, 1, 0}, { 0, 0, 1} }, - .rot_standard_ref = { - {-1, 0, 0}, - { 0, -1, 0}, - { 0, 0, -1} - }, .hinge_axis = {0, 1, 0}, }; diff --git a/board/samus/board.h b/board/samus/board.h index a203b94a9b..757f0ca950 100644 --- a/board/samus/board.h +++ b/board/samus/board.h @@ -21,11 +21,13 @@ #define CONFIG_ALS_ISL29035 #define CONFIG_BOARD_VERSION #define CONFIG_CMD_ACCELS +#define CONFIG_CMD_ACCEL_INFO #define CONFIG_POWER_COMMON #define CONFIG_CHIPSET_CAN_THROTTLE #define CONFIG_KEYBOARD_BOARD_CONFIG #define CONFIG_KEYBOARD_PROTOCOL_8042 #define CONFIG_KEYBOARD_COL2_INVERTED +#define CONFIG_LID_ANGLE #define CONFIG_LIGHTBAR_POWER_RAILS #define CONFIG_LOW_POWER_IDLE #define CONFIG_POWER_BUTTON @@ -189,6 +191,9 @@ int board_discharge_on_ac(int enable); #define CONFIG_GESTURE_TAP_MIN_INTERSTICE_T 120 #define CONFIG_GESTURE_TAP_MAX_INTERSTICE_T 500 +#define CONFIG_SENSOR_BASE 0 +#define CONFIG_SENSOR_LID 1 + #endif /* !__ASSEMBLER__ */ #endif /* __BOARD_H */ |