summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-08-30 21:44:08 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-09-11 13:50:56 -0700
commit17296409d8eec57bd3f11c8835ad13f22d4f13fc (patch)
tree9e516c4ce332f9e7278266c1a670d02eac1dbf64
parent3b1847d81053d211febc98604f4a3101c389f1ac (diff)
downloadchrome-ec-17296409d8eec57bd3f11c8835ad13f22d4f13fc.tar.gz
common: Add variable to enable software gesture recognition.
Gesture recognition can be done in software (by the EC) or in hardware, by the sensor itself. Add variable to compile gesture.c only in the software case. BRANCH=smaug TEST=compile. BUG=b:23570481 Change-Id: I22bef0bf744516df267020d9458e0299a4da3d72 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/296211 Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--board/samus/board.h1
-rw-r--r--common/build.mk2
-rw-r--r--common/motion_sense.c2
-rw-r--r--include/config.h14
4 files changed, 15 insertions, 4 deletions
diff --git a/board/samus/board.h b/board/samus/board.h
index 3acd4bc427..ac3ba82b09 100644
--- a/board/samus/board.h
+++ b/board/samus/board.h
@@ -57,6 +57,7 @@
#define CONFIG_FANS 2
#define CONFIG_FAN_UPDATE_PERIOD 10
#define CONFIG_GESTURE_DETECTION
+#define CONFIG_GESTURE_SW_DETECTION
#define CONFIG_GESTURE_SAMPLING_INTERVAL_MS 5
#undef CONFIG_HIBERNATE_DELAY_SEC
#define CONFIG_HIBERNATE_DELAY_SEC (3600 * 24 * 7)
diff --git a/common/build.mk b/common/build.mk
index 1679ed4487..312797ce87 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -46,7 +46,7 @@ common-$(CONFIG_EXTPOWER_GPIO)+=extpower_gpio.o
common-$(CONFIG_FANS)+=fan.o
common-$(CONFIG_FLASH)+=flash.o
common-$(CONFIG_FMAP)+=fmap.o
-common-$(CONFIG_GESTURE_DETECTION)+=gesture.o
+common-$(CONFIG_GESTURE_SW_DETECTION)+=gesture.o
common-$(CONFIG_HOSTCMD_EVENTS)+=host_event_commands.o
common-$(CONFIG_HOSTCMD_PD)+=host_command_master.o
common-$(CONFIG_I2C)+=i2c.o
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 0e32f6c97c..fdc36cd134 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -562,7 +562,7 @@ void motion_sense_task(void)
}
}
-#ifdef CONFIG_GESTURE_DETECTION
+#ifdef CONFIG_GESTURE_SW_DETECTION
/* Run gesture recognition engine */
gesture_calc();
#endif
diff --git a/include/config.h b/include/config.h
index e35f40d241..06652c3059 100644
--- a/include/config.h
+++ b/include/config.h
@@ -796,10 +796,16 @@
/* Do we want to detect gestures? */
#undef CONFIG_GESTURE_DETECTION
-/* Which sensor to look for gesture recognition */
-#undef CONFIG_GESTURE_SENSOR_BATTERY_TAP
+/* some gesture recognition done in software */
+#undef CONFIG_GESTURE_SW_DETECTION
+/* some gesture recognition done in hardware */
+#undef CONFIG_GESTURE_HW_DETECTION
/* Sensor sampling interval for gesture recognition */
#undef CONFIG_GESTURE_SAMPLING_INTERVAL_MS
+
+/* Which sensor to look for gesture recognition */
+#undef CONFIG_GESTURE_SENSOR_BATTERY_TAP
+
/*
* Double tap detection parameters
* Double tap works by looking for two isolated Z-axis accelerometer impulses
@@ -810,11 +816,15 @@
* period before the initial tap impluse and after the final tap impulse for
* which to check for relatively calm periods. In between the two impulses
* there is a minimum and maximum interstice time allowed.
+ *
+ * Define an acceleration threshold to dectect a tap, in mg.
*/
#undef CONFIG_GESTURE_TAP_OUTER_WINDOW_T
#undef CONFIG_GESTURE_TAP_INNER_WINDOW_T
#undef CONFIG_GESTURE_TAP_MIN_INTERSTICE_T
#undef CONFIG_GESTURE_TAP_MAX_INTERSTICE_T
+#undef CONFIG_GESTURE_TAP_THRES_MG
+
/* Do we want to detect the lid angle? */
#undef CONFIG_LID_ANGLE