diff --git a/board/ryu/board.c b/board/ryu/board.c index 24402d42fc..9370493893 100644 --- a/board/ryu/board.c +++ b/board/ryu/board.c @@ -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, diff --git a/board/ryu/board.h b/board/ryu/board.h index aac0a766d4..db06bf1e1a 100644 --- a/board/ryu/board.h +++ b/board/ryu/board.h @@ -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