diff options
| author | Henrik Rydberg <rydberg@bitmath.org> | 2010-07-26 13:51:34 +0200 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2010-08-05 22:48:38 +0200 |
| commit | b76660d71e2ea77752025089bd71deffad64e325 (patch) | |
| tree | c19adf132087edcdc1e721446d4975f37899239e /src/touch-dev.c | |
| parent | eb896e11aacab5f53e3915a8d19ffffd92ce8e10 (diff) | |
Test implementation of grail api
This patch introduces the grail API, and a program to test it (evlink).
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Diffstat (limited to 'src/touch-dev.c')
| -rw-r--r-- | src/touch-dev.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/touch-dev.c b/src/touch-dev.c index 80cc82f..dc23baa 100644 --- a/src/touch-dev.c +++ b/src/touch-dev.c | |||
| @@ -65,11 +65,9 @@ static void finish_touch(struct touch_dev *dev, | |||
| 65 | static void finish_packet(struct touch_dev *dev, | 65 | static void finish_packet(struct touch_dev *dev, |
| 66 | const struct input_event *syn) | 66 | const struct input_event *syn) |
| 67 | { | 67 | { |
| 68 | static const touch_time_t ms = 1000; | ||
| 69 | touch_time_t time = syn->time.tv_usec / ms + syn->time.tv_sec * ms; | ||
| 70 | finish_touch(dev, dev->impl); | 68 | finish_touch(dev, dev->impl); |
| 71 | if (dev->sync) | 69 | if (dev->sync) |
| 72 | dev->sync(dev, time); | 70 | dev->sync(dev, syn); |
| 73 | } | 71 | } |
| 74 | 72 | ||
| 75 | static int handle_abs_event(struct touch_dev *dev, | 73 | static int handle_abs_event(struct touch_dev *dev, |
| @@ -133,6 +131,8 @@ int touch_dev_open(struct touch_dev *dev, int fd) | |||
| 133 | if (!x) | 131 | if (!x) |
| 134 | return -ENOMEM; | 132 | return -ENOMEM; |
| 135 | ret = mtdev_open(&x->mtdev, fd); | 133 | ret = mtdev_open(&x->mtdev, fd); |
| 134 | if (!ret && !x->mtdev.caps.has_mtdata) | ||
| 135 | ret = -ENODEV; | ||
| 136 | if (ret) | 136 | if (ret) |
| 137 | goto error; | 137 | goto error; |
| 138 | for (i = 0; i < DIM_TOUCH; i++) | 138 | for (i = 0; i < DIM_TOUCH; i++) |
