firmware_TouchpadMTB: largest gap ratio to detect gaps

This CL fine tuned the way to detect a large gap. When calculating
the gap ratio, we primarily consider the ratio between current gap
and the previous gap, where

  gap(Pi) = distance between P[i] and P[i-1]
  gap_ratio_with_prev = curr_gap / prev_gap

This could detect gaps more precisely than the previous one using

  gap_ratio = curr_gap / ((prev_gap + next_gap) / 2)

BUG=chromium-os:35024
TEST=None. Will be tested in a validator_unittest checked in later.

Change-Id: If6484e99f751c024d5e4de2e1261e2b35bcdc93a
Reviewed-on: https://gerrit.chromium.org/gerrit/34870
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Commit-Ready: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
1 file changed