From affc464caaad58d15e1ab5ad908a6c870d4a4522 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 31 Jan 2023 19:24:55 +1000 Subject: [PATCH] util-time: fix the us2ms function Turns out this was converting in the wrong direction and the only call site we had didn't notice/care. --- src/util-time.h | 2 +- tools/ei-demo-client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util-time.h b/src/util-time.h index 52de366..a49e396 100644 --- a/src/util-time.h +++ b/src/util-time.h @@ -42,7 +42,7 @@ us(uint64_t us) static inline uint64_t us2ms(uint64_t us) { - return us * 1000; + return us / 1000; } static inline uint64_t diff --git a/tools/ei-demo-client.c b/tools/ei-demo-client.c index 88e4fc8..7c1d080 100644 --- a/tools/ei-demo-client.c +++ b/tools/ei-demo-client.c @@ -455,7 +455,7 @@ int main(int argc, char **argv) if (!receiver) { uint64_t now = ei_now(ei); - uint32_t interval = us2ms(10); /* pretend events are 10ms apart */ + uint64_t interval = ms2us(10); /* pretend events are 10ms apart */ if (have_ptr) { colorprint("sending motion event\n");