diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2010-03-21 14:18:56 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-03-21 14:57:59 +0100 |
| commit | c7ed4cec501f10479a98e380d760670312101136 (patch) | |
| tree | 3e42dc0e2f7d152044555bc178ab47d324aaa277 /src/state.c | |
| parent | d5b3178ca184dee4b3116e5b569745d43dbe37ef (diff) | |
Comply with MT syncronization protocol
The latest semantic clarifications in the kernel MT protocol allow
SYN_MT_REPORT to be sent without actually sending any finger data. Add
a mask to the hardware data so that the data actually read can be
tracked.
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/state.c b/src/state.c index 774828a..31eca70 100644 --- a/src/state.c +++ b/src/state.c | |||
| @@ -36,16 +36,9 @@ static int fincmp(const void *a, const void *b) | |||
| 36 | return ((struct FingerState *)a)->id - ((struct FingerState *)b)->id; | 36 | return ((struct FingerState *)a)->id - ((struct FingerState *)b)->id; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | /* seander@cs.stanford.edu */ | ||
| 40 | inline unsigned abs32(int x) | ||
| 41 | { | ||
| 42 | int const m = x >> 31; | ||
| 43 | return (x + m) ^ m; | ||
| 44 | } | ||
| 45 | |||
| 46 | inline int abs15(int x) | 39 | inline int abs15(int x) |
| 47 | { | 40 | { |
| 48 | return 32767 & abs32(x); | 41 | return 32767 & (x < 0 ? -x : x); |
| 49 | } | 42 | } |
| 50 | 43 | ||
| 51 | /* abslute scale is assumed to fit in 15 bits */ | 44 | /* abslute scale is assumed to fit in 15 bits */ |
