summaryrefslogtreecommitdiff
path: root/common/body_detection.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2020-10-20 23:45:56 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-06 01:43:32 +0000
commit25588eb6a324d4e9f72b1a25fdcef4fc55bd653f (patch)
tree7320f61f6ef271ae36aadfb1d9f708123a37baf4 /common/body_detection.c
parent2d900dc16b610703296803e438a8728036c06ea4 (diff)
downloadchrome-ec-25588eb6a324d4e9f72b1a25fdcef4fc55bd653f.tar.gz
common: body: Use IS_ENABLED
BUG=chromium:1140877 BRANCH=none TEST=buildall Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: Iac63ec83258d1194d2b035c1dd67b6f915d37c16 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2489462 Reviewed-by: Ching-Kang Yen <chingkang@chromium.org>
Diffstat (limited to 'common/body_detection.c')
-rw-r--r--common/body_detection.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/common/body_detection.c b/common/body_detection.c
index f7ea95c8c4..334009e320 100644
--- a/common/body_detection.c
+++ b/common/body_detection.c
@@ -92,17 +92,17 @@ static int calculate_motion_confidence(uint64_t var)
/* Change the motion state and commit the change to AP. */
void body_detect_change_state(enum body_detect_states state)
{
-#ifdef CONFIG_GESTURE_HOST_DETECTION
- struct ec_response_motion_sensor_data vector = {
- .flags = MOTIONSENSE_SENSOR_FLAG_WAKEUP,
- .activity = MOTIONSENSE_ACTIVITY_BODY_DETECTION,
- .state = state,
- .sensor_num = MOTION_SENSE_ACTIVITY_SENSOR_ID,
- };
- motion_sense_fifo_stage_data(&vector, NULL, 0,
- __hw_clock_source_read());
- motion_sense_fifo_commit_data();
-#endif
+ if (IS_ENABLED(CONFIG_GESTURE_HOST_DETECTION)) {
+ struct ec_response_motion_sensor_data vector = {
+ .flags = MOTIONSENSE_SENSOR_FLAG_WAKEUP,
+ .activity = MOTIONSENSE_ACTIVITY_BODY_DETECTION,
+ .state = state,
+ .sensor_num = MOTION_SENSE_ACTIVITY_SENSOR_ID,
+ };
+ motion_sense_fifo_stage_data(&vector, NULL, 0,
+ __hw_clock_source_read());
+ motion_sense_fifo_commit_data();
+ }
/* change the motion state */
motion_state = state;
if (state == BODY_DETECTION_ON_BODY) {