libftdi: remove package and replace with package 'libftdi1', patch files for files using it this lib

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Philipp Felix Hoefler
2014-11-21 14:19:45 +01:00
committed by Stephan Raue
parent ded704d1f8
commit 0e73cf3bdf
8 changed files with 198 additions and 30 deletions

View File

@@ -23,7 +23,7 @@ PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.lirc.org"
PKG_URL="$SOURCEFORGE_SRC/lirc/$PKG_NAME-$PKG_VERSION.tar.bz2"
PKG_DEPENDS_TARGET="toolchain libftdi libusb-compat libirman"
PKG_DEPENDS_TARGET="toolchain libftdi1 libusb-compat libirman"
PKG_PRIORITY="optional"
PKG_SECTION="sysutils/remote"
PKG_SHORTDESC="lirc: Linux Infrared Remote Control"

View File

@@ -0,0 +1,70 @@
diff --git a/configure.ac b/configure.ac
index 74ccba8..e40f51a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -318,7 +318,7 @@ AC_CHECK_HEADER(usb.h,
AC_DEFINE(HAVE_LIBUSB)
possible_drivers="${possible_drivers} (atilibusb) (awlibusb) (dfclibusb) (commandir) (srm7500libusb)"
)
-AC_CHECK_HEADER(ftdi.h,
+AC_CHECK_HEADER(libftdi1/ftdi.h,
AC_DEFINE(HAVE_FTDI)
possible_drivers="${possible_drivers} (ftdi)"
)
@@ -533,7 +533,7 @@ if test "$driver" = "userspace" -o "$driver" = "all"; then
;;
ftdi)
hw_module="${hw_module} hw_ftdi.o receive.o transmit.o"
- ftdi_lib="-lftdi"
+ ftdi_lib="-lftdi1"
;;
i2cuser)
hw_module="${hw_module} hw_i2cuser.o receive.o"
@@ -934,7 +934,7 @@ if test "$driver" = "ftdi"; then
lirc_driver="none"
hw_module="hw_ftdi.o receive.o transmit.o"
HW_DEFAULT="hw_ftdi"
- ftdi_lib="-lftdi"
+ ftdi_lib="-lftdi1"
fi
if test "$driver" = "gvbctv5pci"; then
diff --git a/daemons/hw_ftdi.c b/daemons/hw_ftdi.c
index d867bc9..e5ef563 100644
--- a/daemons/hw_ftdi.c
+++ b/daemons/hw_ftdi.c
@@ -51,7 +51,7 @@
#include "transmit.h"
#include "hw_default.h"
-#include <ftdi.h>
+#include <libftdi1/ftdi.h>
/* PID of the child process */
static pid_t child_pid = -1;
@@ -62,6 +62,7 @@ static pid_t child_pid = -1;
static char *device_config = NULL;
static int tx_baud_rate = 65536;
static int rx_baud_rate = 9600;
+static int rx_sample_rate = 16;
static int input_pin = 1; /* RXD as input */
static int output_pin = 2; /* RTS as output */
static int usb_vendor = 0x0403; /* default for FT232 */
@@ -94,7 +95,7 @@ static void parsesamples(unsigned char *buf, int n, int pipe_rxir_w)
* The datasheet indicates that the sample rate in
* bitbang mode is 16 times the baud rate but 32 seems
* to be correct. */
- usecs = (rxctr * 1000000LL) / (rx_baud_rate * 32);
+ usecs = (rxctr * 1000000LL) / (rx_baud_rate * rx_sample_rate);
/* Clamp */
if (usecs > PULSE_MASK) {
@@ -142,7 +143,7 @@ static void child_process(int fd_rx2main, int fd_main2tx, int fd_tx2main)
/* Enable bit-bang mode, setting output & input pins
direction */
- if (ftdi_enable_bitbang(&ftdic, 1 << output_pin) < 0) {
+ if (ftdi_set_bitmode(&ftdic, 1 << output_pin, BITMODE_BITBANG) < 0) {
logprintf(LOG_ERR, "unable to enable bitbang mode (%s)", ftdi_get_error_string(&ftdic));
goto retry;
}