libftdi Archives

Subject: Re: libftdi: Make ftdi_read_data() honor usb_read_timeout

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 28 Jun 2010 13:40:18 +0200
>>>>> "Xiaofan" == Xiaofan Chen <xiaofanc@xxxxxxxxx> writes:

...
    Xiaofan> Since both MinGW and Cygwin have this one, maybe the above is
    Xiaofan> needed.

What do you want to say with this?
Should we use the replacement function or gettimeofday()?

    Xiaofan> On the other hand, from what I read, the function gettimeofday
    Xiaofan> under MinGW/Cygwin may not provide good resolution for timeout
    Xiaofan> (>10ms). If that is not good enough, people seems to use
    Xiaofan> QueryPerformanceCounter.

The normal code path it that the read is satisfied by enough bytes read from
the USB channel. Only on failure, either in the hardware or in the data sent
to the device, the timeout is hit. So even if we request 1 ms and we get 20
ms by the bad resolution of the function, any well written program should
not be impacted, as the timeout is not hit.

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread