X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi_stream.c;h=f5f128730d74c43f41dfbd8ac11aaf9368075c40;hp=21806729bf703f46d5a61c0673a5bc3fbad319b3;hb=c0182e62d7c607205652d7860e92618181b667de;hpb=74387f27647e7123e233d31d36daedc6b485650a diff --git a/src/ftdi_stream.c b/src/ftdi_stream.c index 2180672..f5f1287 100644 --- a/src/ftdi_stream.c +++ b/src/ftdi_stream.c @@ -3,6 +3,7 @@ ------------------- copyright : (C) 2009 Micah Dowty 2010 Uwe Bonnes email : opensource@intra2net.com + SPDX-License-Identifier: (LGPL-2.1-only AND MIT) ***************************************************************************/ /*************************************************************************** @@ -41,6 +42,9 @@ #include #include +#ifndef _WIN32 +#include +#endif #include #include "ftdi.h" @@ -61,7 +65,7 @@ typedef struct * * state->result is only set when some error happens */ -static void +static void LIBUSB_CALL ftdi_readstream_cb(struct libusb_transfer *transfer) { FTDIStreamState *state = transfer->user_data; @@ -169,9 +173,9 @@ ftdi_readstream(struct ftdi_context *ftdi, } /* Purge anything remaining in the buffers*/ - if (ftdi_usb_purge_buffers(ftdi) < 0) + if (ftdi_tcioflush(ftdi) < 0) { - fprintf(stderr,"Can't Purge\n"); + fprintf(stderr,"Can't flush FIFOs & buffers\n"); return 1; } @@ -237,7 +241,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);