Divide the whole seconds into tv_sec, and the remaining microseconds into tv_usec.
Signed-off-by: Matthias Klein <matth...@extraklein.de> --- src/ftdi_stream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ftdi_stream.c b/src/ftdi_stream.c index f5f1287..e6c5312 100644 --- a/src/ftdi_stream.c +++ b/src/ftdi_stream.c @@ -241,7 +241,8 @@ ftdi_readstream(struct ftdi_context *ftdi, { FTDIProgressInfo *progress = &state.progress; const double progressInterval = 1.0; - struct timeval timeout = { 0, ftdi->usb_read_timeout * 1000}; + struct timeval timeout = { ftdi->usb_read_timeout / 1000, + (ftdi->usb_read_timeout % 1000) * 1000}; struct timeval now; int err = libusb_handle_events_timeout(ftdi->usb_ctx, &timeout); -- 2.30.2 -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com