set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
-option(ASYNC-MODE "enable experimental async mode. Linux only")
-if(ASYNC-MODE)
- add_definitions(-DLIBFTDI_LINUX_ASYNC_MODE)
-endif(ASYNC-MODE)
-
# CMake
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_BUILD_TYPE Debug)
AC_MSG_ERROR([libusb-1.0 not found.])
fi
-ENABLE_ASYNC_MODE=0
-AC_ARG_WITH(async-mode,
-[ --with-async-mode enable experimental async mode. Linux only.],
-[
- AC_MSG_CHECKING(for experimental linux async mode)
- if test "$withval" != "no"; then
- ENABLE_ASYNC_MODE=1
- CFLAGS="$CFLAGS -DLIBFTDI_LINUX_ASYNC_MODE"
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- fi
-])
-AC_SUBST(ENABLE_ASYNC_MODE)
-
AC_ARG_WITH(examples,
AS_HELP_STRING([--without-examples], [disable example programs]))
AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$with_examples" != "xno"])
-%define enable_async_mode @ENABLE_ASYNC_MODE@
Summary: Library to program and control the FTDI USB controller
Name: libftdi
Version: @VERSION@
PARAMS=""
./configure --prefix=%{prefix} \
- --libdir=%{_libdir} \
-%if %{enable_async_mode}
- --with-async-mode \
+ --libdir=%{_libdir}
%endif
make
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
return ret;
}
-#endif // LIBFTDI_LINUX_ASYNC_MODE
-
/**
Configure write buffer chunk size.
Default is 4096.