ryu: Enable Significant motion

Enable significant motion in BMI160 and from the host.

BRANCH=smaug
BUG=b:23570481
TEST=On Ryu, check significant motion (not still) is detected.

Change-Id: I7d524576f18829f79991d731c5691b3d2bba5d36
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/296215
This commit is contained in:
Gwendal Grignou
2015-08-30 21:30:15 -07:00
committed by chrome-bot
parent 8139114897
commit 6f06cd5f7b
2 changed files with 17 additions and 10 deletions

View File

@@ -298,15 +298,15 @@ struct motion_sensor_t motion_sensors[] = {
.odr = 0,
.ec_rate = 0,
},
/* EC does not need accel in S0 */
/* EC needs accel for activity recognition. */
[SENSOR_CONFIG_EC_S0] = {
.odr = 0,
.odr = 12500,
/* Interrupt driven, no polling */
.ec_rate = 0,
},
/* Used for double tap */
[SENSOR_CONFIG_EC_S3] = {
.odr = 100000,
/* Interrupt driven, no polling */
.ec_rate = 0,
},
[SENSOR_CONFIG_EC_S5] = {
@@ -315,7 +315,6 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
{.name = "Gyro",
.active_mask = SENSOR_ACTIVE_S0_S3,
.chip = MOTIONSENSE_CHIP_BMI160,
@@ -333,7 +332,7 @@ struct motion_sensor_t motion_sensors[] = {
.odr = 0,
.ec_rate = 0,
},
/* EC does not need accel in S0 */
/* EC does not need gyro in S0 */
[SENSOR_CONFIG_EC_S0] = {
.odr = 0,
.ec_rate = 0,
@@ -349,7 +348,6 @@ struct motion_sensor_t motion_sensors[] = {
},
},
},
{.name = "Mag",
.active_mask = SENSOR_ACTIVE_S0_S3,
.chip = MOTIONSENSE_CHIP_BMI160,
@@ -367,7 +365,7 @@ struct motion_sensor_t motion_sensors[] = {
.odr = 0,
.ec_rate = 0,
},
/* EC does not need accel in S0 */
/* EC does not need compass in S0 */
[SENSOR_CONFIG_EC_S0] = {
.odr = 0,
.ec_rate = 0,
@@ -400,7 +398,7 @@ struct motion_sensor_t motion_sensors[] = {
.odr = 0,
.ec_rate = 0,
},
/* EC to use to set led brightness */
/* EC needs sensor for light adaptive brightness */
[SENSOR_CONFIG_EC_S0] = {
.odr = 1000,
.ec_rate = 1000,
@@ -433,7 +431,7 @@ struct motion_sensor_t motion_sensors[] = {
.odr = 0,
.ec_rate = 0,
},
/* EC does not need accel in S0 */
/* EC does not need proximity in S0 */
[SENSOR_CONFIG_EC_S0] = {
.odr = 0,
.ec_rate = 0,

View File

@@ -154,15 +154,24 @@
/* Sensor support */
#define CONFIG_ACCELGYRO_BMI160
#define CONFIG_GESTURE_DETECTION
#define CONFIG_GESTURE_HW_DETECTION
#define CONFIG_GESTURE_HOST_DETECTION
/* First sensor is motion_sensor is used for significant motion */
#define CONFIG_GESTURE_SIGMO 0
#define CONFIG_GESTURE_SIGMO_PROOF_MS 500
#define CONFIG_GESTURE_SIGMO_SKIP_MS 3000
#define CONFIG_GESTURE_SIGMO_THRES_MG 500
#define CONFIG_GESTURE_SENSOR_BATTERY_TAP 0
#define CONFIG_GESTURE_TAP_THRES_MG 200
#define CONFIG_GESTURE_DETECTION_MASK \
((1 << CONFIG_GESTURE_SIGMO) | \
(1 << CONFIG_GESTURE_SENSOR_BATTERY_TAP))
#define CONFIG_MAG_BMI160_BMM150
#define CONFIG_ALS_SI114X 0x41
#define CONFIG_ACCELGYRO_BMI160_INT_EVENT TASK_EVENT_CUSTOM(4)
#define CONFIG_ALS_SI114X_INT_EVENT TASK_EVENT_CUSTOM(8)
/* event 2 to 9 are reserved for hardware interrupt */
#define CONFIG_GESTURE_TAP_EVENT TASK_EVENT_CUSTOM(1024)
#define CONFIG_GESTURE_SIGMO_EVENT TASK_EVENT_CUSTOM(2048)
#define CONFIG_ACCEL_INTERRUPTS
#define CONFIG_CMD_ACCELS
#define CONFIG_CMD_ACCEL_INFO