summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2015-08-30 21:44:08 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-08-25 20:57:40 +0000
commitc87bef6298ebbaca3bca46b4c5c82126284a7341 (patch)
tree07ff32cfe29a00ea7e2906b46f78d6d8f2fa04b5
parent169907522825b9779dcc76fecf426af5b2d2056d (diff)
downloadchrome-ec-c87bef6298ebbaca3bca46b4c5c82126284a7341.tar.gz
UPSTREAM: 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, samus TEST=compile. BUG=b:23570481, b:27849483 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> (cherry picked from commit 17296409d8eec57bd3f11c8835ad13f22d4f13fc) Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/370525
-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 6780986f40..68a8fb665a 100644
--- a/board/samus/board.h
+++ b/board/samus/board.h
@@ -55,6 +55,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 bc6080f4b0..95eb82edaf 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -50,7 +50,7 @@ common-$(CONFIG_EXTPOWER_SPRING)+=extpower_spring.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_I2C)+=i2c.o
common-$(CONFIG_I2C_ARBITRATION)+=i2c_arbitration.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 973bf99607..0eba84c853 100644
--- a/include/config.h
+++ b/include/config.h
@@ -640,10 +640,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
@@ -654,11 +660,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