[PATCH] tv_usec field of timeval is in microseconds, not ms

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] tv_usec field of timeval is in microseconds, not ms

Ларионов Даниил
Hi all.
 
ftdi_readstream seems to set an invalid timeout for libusb_handle_events_timeout.
It's not critical, but the event processing loop wakes up 1000 times more frequently.

---
 src/ftdi_stream.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ftdi_stream.c b/src/ftdi_stream.c
index d295a02..2ad54c0 100644
--- a/src/ftdi_stream.c
+++ b/src/ftdi_stream.c
@@ -237,7 +237,7 @@ ftdi_readstream(struct ftdi_context *ftdi,
    {
        FTDIProgressInfo  *progress = &state.progress;
        const double progressInterval = 1.0;
-        struct timeval timeout = { 0, ftdi->usb_read_timeout };
+        struct timeval timeout = { 0, ftdi->usb_read_timeout * 1000};
        struct timeval now;
 
        int err = libusb_handle_events_timeout(ftdi->usb_ctx, &timeout);
--
2.1.4

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]  

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] tv_usec field of timeval is in microseconds, not ms

Thomas Jarosch
Hi,

Am 09.04.2015 um 20:01 schrieb Ларионов Даниил:
> Hi all.
>  
> ftdi_readstream seems to set an invalid timeout for libusb_handle_events_timeout.
> It's not critical, but the event processing loop wakes up 1000 times more frequently.

...after going through my backlog of libftdi patches,
looks like I've missed this one. Sorry!

Applied - finally :)

Cheers,
Thomas


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [hidden email]  

Loading...