diff options
-rw-r--r-- | board/eve/board.c | 17 | ||||
-rw-r--r-- | board/eve/board.h | 11 |
2 files changed, 23 insertions, 5 deletions
diff --git a/board/eve/board.c b/board/eve/board.c index deb6f99786..01975ac869 100644 --- a/board/eve/board.c +++ b/board/eve/board.c @@ -25,6 +25,7 @@ #include "driver/tcpm/tcpm.h" #include "driver/temp_sensor/bd99992gw.h" #include "extpower.h" +#include "gesture.h" #include "gpio.h" #include "hooks.h" #include "host_command.h" @@ -728,6 +729,12 @@ int board_get_version(void) return ver; } +void sensor_board_proc_double_tap(void) +{ + /* TODO: Call led update function */ + CPRINTS("Call LED status update"); +} + /* Base Sensor mutex */ static struct mutex g_base_mutex; @@ -792,7 +799,7 @@ struct motion_sensor_t motion_sensors[] = { [BASE_ACCEL] = { .name = "Base Accel", - .active_mask = SENSOR_ACTIVE_S0_S3, + .active_mask = SENSOR_ACTIVE_S0_S3_S5, .chip = MOTIONSENSE_CHIP_BMI160, .type = MOTIONSENSE_TYPE_ACCEL, .location = MOTIONSENSE_LOC_BASE, @@ -813,18 +820,18 @@ struct motion_sensor_t motion_sensors[] = { }, /* EC use accel for angle detection */ [SENSOR_CONFIG_EC_S0] = { - .odr = 10000 | ROUND_UP_FLAG, + .odr = TAP_ODR, .ec_rate = 100 * MSEC, }, /* Sensor on for lid angle detection */ [SENSOR_CONFIG_EC_S3] = { - .odr = 10000 | ROUND_UP_FLAG, + .odr = TAP_ODR, .ec_rate = 100 * MSEC, }, /* Sensor off in S5 */ [SENSOR_CONFIG_EC_S5] = { - .odr = 0, - .ec_rate = 0 + .odr = TAP_ODR, + .ec_rate = 100 * MSEC, }, }, }, diff --git a/board/eve/board.h b/board/eve/board.h index a018e9f96c..29967c07ef 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -140,6 +140,17 @@ /* Depends on how fast the AP boots and typical ODRs */ #define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +/* Enable double tap detection */ +#define CONFIG_GESTURE_DETECTION +#define CONFIG_GESTURE_HOST_DETECTION +#define CONFIG_GESTURE_SENSOR_BATTERY_TAP 1 +#define CONFIG_GESTURE_SAMPLING_INTERVAL_MS 5 +#define CONFIG_GESTURE_TAP_THRES_MG 100 +#define CONFIG_GESTURE_TAP_MAX_INTERSTICE_T 500 +#define CONFIG_GESTURE_DETECTION_MASK \ + (1 << CONFIG_GESTURE_SENSOR_BATTERY_TAP) +#define CONFIG_GESTURE_TAP_EVENT TASK_EVENT_CUSTOM(1024) + /* USB */ #define CONFIG_USB_CHARGER #define CONFIG_USB_PD_ALT_MODE |