From 6343b2c56f93ca5d308e444b2026f26777139ee4 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Fri, 29 May 2015 13:26:29 -0700 Subject: [PATCH] px4_poll fix - was sleeping for usec instead of ms There was a conversion error in the timeout (in ms) passed in and the ts.tv_nsec field of the struct timeval. Signed-off-by: Mark Charlebois --- src/drivers/device/vdev_posix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/device/vdev_posix.cpp b/src/drivers/device/vdev_posix.cpp index 0e94e88dfe..e961751153 100644 --- a/src/drivers/device/vdev_posix.cpp +++ b/src/drivers/device/vdev_posix.cpp @@ -242,7 +242,7 @@ int px4_poll(px4_pollfd_struct_t *fds, nfds_t nfds, int timeout) void *res; ts.tv_sec = timeout/1000; - ts.tv_nsec = (timeout % 1000)*1000; + ts.tv_nsec = (timeout % 1000)*1000000; // Create a timer to unblock struct timerData td(sem, ts);