diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2015-09-25 14:57:13 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-09-28 14:51:57 -0700 |
commit | cf25d26c2740cb86adf235ee33dd15653c7c522b (patch) | |
tree | b228625b1b9af4e00d9ba8cdf7b95a4c6ff9f3db /common/motion_sense.c | |
parent | a0a1d18e06053b3cf2f390d31cd032560b184544 (diff) | |
download | chrome-ec-cf25d26c2740cb86adf235ee33dd15653c7c522b.tar.gz |
common: motion: Fix setting of Significant motion.
cl/296213 had another bug that prevent Significant motion gesture to be
set: In set_activity, activity is a number, not a bitfield.
BRANCH=smaug
BUG=chrome-os-partner:45704
TEST=With ectool motionsense set_activity and list_activity,
check we can set/reset the significant motion activity.
Change-Id: Iff921f3f5edcee74ed3540139f13da301f149173
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/302641
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r-- | common/motion_sense.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c index f05e8e91b0..2451ec9c75 100644 --- a/common/motion_sense.c +++ b/common/motion_sense.c @@ -1058,7 +1058,8 @@ static int host_cmd_motion_sense(struct host_cmd_handler_args *args) sensor = &motion_sensors[i]; sensor->drv->list_activities(sensor, &enabled, &disabled); - if (in->set_activity.activity & (enabled | disabled)) + if ((1 << in->set_activity.activity) & + (enabled | disabled)) ret = sensor->drv->manage_activity(sensor, in->set_activity.activity, in->set_activity.enable, |