return offset;
}
-#ifdef LIBFTDI_LINUX_ASYNC_MODE
-#ifdef USB_CLASS_PTP
-#error LIBFTDI_LINUX_ASYNC_MODE is not compatible with libusb-compat-0.1!
-#endif
static void ftdi_read_data_cb(struct libusb_transfer *transfer)
{
struct ftdi_transfer_control *tc = (struct ftdi_transfer_control *) transfer->user_data;
Writes data to the chip. Does not wait for completion of the transfer
nor does it make sure that the transfer was successful.
- Use libusb 1.0 Asynchronous API.
- Only available if compiled with --with-async-mode.
+ Use libusb 1.0 asynchronous API.
\param ftdi pointer to ftdi_context
\param buf Buffer with the data
Reads data from the chip. Does not wait for completion of the transfer
nor does it make sure that the transfer was successful.
- Use libusb 1.0 Asynchronous API.
- Only available if compiled with --with-async-mode.
+ Use libusb 1.0 asynchronous API.
\param ftdi pointer to ftdi_context
\param buf Buffer with the data
/**
Wait for completion of the transfer.
- Use libusb 1.0 Asynchronous API.
- Only available if compiled with --with-async-mode.
+ Use libusb 1.0 asynchronous API.
\param tc pointer to ftdi_transfer_control
while (!tc->completed)
{
- ret = libusb_handle_events(ftdi->usb_ctx);
+ ret = libusb_handle_events(tc->ftdi->usb_ctx);
if (ret < 0)
{
if (ret == LIBUSB_ERROR_INTERRUPTED)
continue;
libusb_cancel_transfer(tc->transfer);
while (!tc->completed)
- if (libusb_handle_events(ftdi->usb_ctx) < 0)
+ if (libusb_handle_events(tc->ftdi->usb_ctx) < 0)
break;
libusb_free_transfer(tc->transfer);
free (tc);
return ret;
}
-#endif // LIBFTDI_LINUX_ASYNC_MODE
-
/**
Configure write buffer chunk size.
Default is 4096.