From 99737a2fefa7eab7c63cddd31bea7afdf717620c Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Thu, 30 Apr 2015 14:27:14 -0700 Subject: cleanup: rename motion sensor CONFIG_ options This renames some motion sensor options to start with more consistent prefixes. For gesture (tap) detection: CONFIG_GESTURE_DETECTION: CONFIG_SENSOR_BATTERY_TAP => CONFIG_GESTURE_SENSOR_BATTERY_TAP For detecting lid angle: CONFIG_LID_ANGLE: CONFIG_SENSOR_BASE => CONFIG_LID_ANGLE_SENSOR_BASE CONFIG_SENSOR_LID => CONFIG_LID_ANGLE_SENSOR_LID BUG=none BRANCH=none TEST=make buildall Change-Id: Ib8f645902a5585346e1d8d2cbf73d825c896a521 Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/268777 Reviewed-by: Alec Berg Reviewed-by: Randall Spangler --- board/cyan/board.h | 4 ++-- board/samus/board.h | 6 +++--- board/strago/board.h | 4 ++-- common/gesture.c | 2 +- common/motion_lid.c | 6 ++++-- include/config.h | 20 ++++++++++---------- test/test_config.h | 4 ++-- 7 files changed, 24 insertions(+), 22 deletions(-) diff --git a/board/cyan/board.h b/board/cyan/board.h index 98b8910f7b..a866ec1f09 100644 --- a/board/cyan/board.h +++ b/board/cyan/board.h @@ -52,8 +52,8 @@ /* Motion */ #define CONFIG_ACCEL_KXCJ9 -#define CONFIG_SENSOR_BASE 0 -#define CONFIG_SENSOR_LID 1 +#define CONFIG_LID_ANGLE_SENSOR_BASE 0 +#define CONFIG_LID_ANGLE_SENSOR_LID 1 #define CONFIG_LID_ANGLE /* Modules we want to exclude */ diff --git a/board/samus/board.h b/board/samus/board.h index dd5e9265a3..8c168cffdc 100644 --- a/board/samus/board.h +++ b/board/samus/board.h @@ -193,14 +193,14 @@ void bkboost_det_interrupt(enum gpio_signal signal); void set_pp5000_in_g3(int mask, int enable); /* Define for sensor tasks */ -#define CONFIG_SENSOR_BATTERY_TAP 0 +#define CONFIG_GESTURE_SENSOR_BATTERY_TAP 0 #define CONFIG_GESTURE_TAP_OUTER_WINDOW_T 200 #define CONFIG_GESTURE_TAP_INNER_WINDOW_T 30 #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 +#define CONFIG_LID_ANGLE_SENSOR_BASE 0 +#define CONFIG_LID_ANGLE_SENSOR_LID 1 #endif /* !__ASSEMBLER__ */ diff --git a/board/strago/board.h b/board/strago/board.h index 510e16913f..3fec75e76b 100644 --- a/board/strago/board.h +++ b/board/strago/board.h @@ -59,8 +59,8 @@ #define CONFIG_CMD_ACCELS #define CONFIG_CMD_ACCEL_INFO #define CONFIG_LID_ANGLE -#define CONFIG_SENSOR_BASE 0 -#define CONFIG_SENSOR_LID 1 +#define CONFIG_LID_ANGLE_SENSOR_BASE 0 +#define CONFIG_LID_ANGLE_SENSOR_LID 1 /* Modules we want to exclude */ #undef CONFIG_EEPROM diff --git a/common/gesture.c b/common/gesture.c index 5c79d04097..ed4443c741 100644 --- a/common/gesture.c +++ b/common/gesture.c @@ -73,7 +73,7 @@ enum tap_states { /* Tap sensor to use */ static struct motion_sensor_t *sensor = -&motion_sensors[CONFIG_SENSOR_BATTERY_TAP]; +&motion_sensors[CONFIG_GESTURE_SENSOR_BATTERY_TAP]; /* Tap state information */ static int history_z[MAX_WINDOW]; /* Changes in Z */ diff --git a/common/motion_lid.c b/common/motion_lid.c index 0dfb8763d7..7bf2c66ac0 100644 --- a/common/motion_lid.c +++ b/common/motion_lid.c @@ -47,8 +47,10 @@ static int lid_angle_is_reliable; /* Pointer to constant acceleration orientation data. */ const struct accel_orientation * const p_acc_orient = &acc_orient; -struct motion_sensor_t *accel_base = &motion_sensors[CONFIG_SENSOR_BASE]; -struct motion_sensor_t *accel_lid = &motion_sensors[CONFIG_SENSOR_LID]; +struct motion_sensor_t *accel_base = + &motion_sensors[CONFIG_LID_ANGLE_SENSOR_BASE]; +struct motion_sensor_t *accel_lid = + &motion_sensors[CONFIG_LID_ANGLE_SENSOR_LID]; /** * Calculate the lid angle using two acceleration vectors, one recorded in diff --git a/include/config.h b/include/config.h index 6e63cec8cd..68eb3cf531 100644 --- a/include/config.h +++ b/include/config.h @@ -660,10 +660,13 @@ /*****************************************************************************/ /* Motion sensor based gesture recognition information */ +/* These all require HAS_TASK_MOTIONSENSE to work */ + +/* Do we want to detect gestures? */ #undef CONFIG_GESTURE_DETECTION -#ifndef CONFIG_GESTURE_DETECTION + /* Which sensor to look for gesture recognition */ -#undef CONFIG_SENSOR_BATTERY_TAP +#undef CONFIG_GESTURE_SENSOR_BATTERY_TAP /* Sensor sampling interval for gesture recognition */ #undef CONFIG_GESTURE_SAMPLING_INTERVAL_MS /* @@ -682,23 +685,20 @@ #undef CONFIG_GESTURE_TAP_MIN_INTERSTICE_T #undef CONFIG_GESTURE_TAP_MAX_INTERSTICE_T -#endif - +/* Do we want to detect the lid angle? */ #undef CONFIG_LID_ANGLE -#ifndef CONFIG_LID_ANGLE -#undef CONFIG_SENSOR_BASE -#undef CONFIG_SENSOR_LID +/* Which sensor is located on the base? */ +#undef CONFIG_LID_ANGLE_SENSOR_BASE +/* Which sensor is located on the lid? */ +#undef CONFIG_LID_ANGLE_SENSOR_LID /* * Allows using the lid angle measurement to determine if key scanning should * be enabled or disabled when chipset is suspended. */ #undef CONFIG_LID_ANGLE_KEY_SCAN -#endif - /*****************************************************************************/ - /* * Support the host asking the EC about the status of the most recent host * command. diff --git a/test/test_config.h b/test/test_config.h index c4bf3f57fa..efaf0ef3b6 100644 --- a/test/test_config.h +++ b/test/test_config.h @@ -52,8 +52,8 @@ #ifdef TEST_MOTION_LID #define CONFIG_LID_ANGLE -#define CONFIG_SENSOR_BASE 0 -#define CONFIG_SENSOR_LID 1 +#define CONFIG_LID_ANGLE_SENSOR_BASE 0 +#define CONFIG_LID_ANGLE_SENSOR_LID 1 #endif #ifdef TEST_SBS_CHARGING -- cgit v1.2.1