Subject: Re: How to use async mode
On 02/04/2010 12:48 AM, Uwe Bonnes wrote:
with my FT2232H test setup, libftdi-1/libusb-1 with asyn mode enabled and
following code snipplet (after setting up everything):
struct ftdi_transfer_control *tc;
int size = (1<<(CHUNKEXP));
unsigned char buf[size];
tc = ftdi_read_data_submit(&ftdic,
res = ftdi_transfer_data_done (tc);
res = ftdi_read_data(&ftdic, buf, size);
/*do something with the data */
I don't see any consistant difference between both modes. Reading tops out
at 22 MByte/sec if no further processing is done. Writing out the data gets
me down to 18 MByte/sec
Probably I use the async mode in some wrong way. Any usage hints welcome!
ftdi_read_data = ftdi_read_data_submit + ftdi_transfer_data_done.
So actually the same code is executed whether do_async is true or not.
Generally async mode is used to submit data transfer requests without
need to wait for their completion until you really need the data read back.
I did those work about half a year ago and then switched to other tasks.
So I need to refresh my memory before answer your question. I will also
try to review and test your patches for libftdi-1 in this week I hope.
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx