diff options
Diffstat (limited to 'test/mtdev-test.c')
| -rw-r--r-- | test/mtdev-test.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/test/mtdev-test.c b/test/mtdev-test.c index 1b3e4f2..773f86a 100644 --- a/test/mtdev-test.c +++ b/test/mtdev-test.c | |||
| @@ -30,9 +30,15 @@ | |||
| 30 | #include <stdio.h> | 30 | #include <stdio.h> |
| 31 | #include <unistd.h> | 31 | #include <unistd.h> |
| 32 | #include <fcntl.h> | 32 | #include <fcntl.h> |
| 33 | #include <stdint.h> | ||
| 34 | |||
| 35 | #ifndef input_event_sec | ||
| 36 | #define input_event_sec time.tv_sec | ||
| 37 | #define input_event_usec time.tv_usec | ||
| 38 | #endif | ||
| 33 | 39 | ||
| 34 | /* year-proof millisecond event time */ | 40 | /* year-proof millisecond event time */ |
| 35 | typedef __u64 mstime_t; | 41 | typedef uint64_t mstime_t; |
| 36 | 42 | ||
| 37 | static int use_event(const struct input_event *ev) | 43 | static int use_event(const struct input_event *ev) |
| 38 | { | 44 | { |
| @@ -47,7 +53,7 @@ static void print_event(const struct input_event *ev) | |||
| 47 | { | 53 | { |
| 48 | static const mstime_t ms = 1000; | 54 | static const mstime_t ms = 1000; |
| 49 | static int slot; | 55 | static int slot; |
| 50 | mstime_t evtime = ev->time.tv_usec / ms + ev->time.tv_sec * ms; | 56 | mstime_t evtime = ev->input_event_usec / ms + ev->input_event_sec * ms; |
| 51 | if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT) | 57 | if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT) |
| 52 | slot = ev->value; | 58 | slot = ev->value; |
| 53 | fprintf(stderr, "%012llx %02d %01d %04x %d\n", | 59 | fprintf(stderr, "%012llx %02d %01d %04x %d\n", |
