diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2014-10-24 15:48:57 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-29 22:23:59 +0000 |
commit | a86b4b0a782cb7614969676b00f8b136c825aab7 (patch) | |
tree | 2da11fb5e6804c608db15916408d79a04543e202 /common/gesture.c | |
parent | 66164f2784b1ca34d9a10febd39c19db064c1750 (diff) | |
download | chrome-ec-a86b4b0a782cb7614969676b00f8b136c825aab7.tar.gz |
gesture: Minor fixes
Set state or numeric when needed
Add debug for the idle state.
BUG=None
BRANCH=ToT
TEST=Check debug appears when enabled. Check tap still works.
Change-Id: Ic4660f70a27464dc68c02fdaef60dc36d7c2edad
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225487
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Diffstat (limited to 'common/gesture.c')
-rw-r--r-- | common/gesture.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/gesture.c b/common/gesture.c index 865309c301..6c5572cd44 100644 --- a/common/gesture.c +++ b/common/gesture.c @@ -180,7 +180,7 @@ static int gesture_tap_for_battery(void) if (delta_z_inner > 13 * delta_z_outer && delta_z_inner > 1 * delta_xy_inner) { delta_z_inner_max = delta_z_inner; - state_cnt = TAP_IDLE; + state_cnt = 0; state = TAP_IMPULSE_1; } break; @@ -254,7 +254,9 @@ static int gesture_tap_for_battery(void) } /* On state transitions, print debug info */ - if (state != state_p && tap_debug) { + if (tap_debug && + (state != state_p || + (state_cnt % 10000 == 9999))) { /* make sure we don't divide by 0 */ if (delta_z_outer == 0 || delta_xy_inner == 0) CPRINTS("tap st %d->%d, error div by 0", @@ -291,7 +293,7 @@ static void gesture_chipset_suspend(void) * record a whole new set of data, and enable tap detection */ history_initialized = 0; - state = 0; + state = TAP_IDLE; history_idx = 0; tap_detection = 1; } |