Add code to use libusb-1.0 asynchronous transfers to fix problem of

occasional missed keys and eliminate use of key_timeout which disrupts the
main loop timing (by M. Jones).
This commit is contained in:
mmdolze
2011-12-10 15:39:46 +00:00
parent 27e7f895fd
commit d7f799285f
8 changed files with 878 additions and 277 deletions
+2 -2
View File
@@ -32,7 +32,7 @@ i2500vfd_CFLAGS = @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
IOWarrior_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
lis_CFLAGS = @LIBUSB_CFLAGS@ @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
mdm166a_CFLAGS = @LIBHID_CFLAGS@ $(AM_CFLAGS)
picolcd_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
picolcd_CFLAGS = @LIBUSB_CFLAGS@ @LIBUSB_1_0_CFLAGS@ $(AM_CFLAGS)
shuttleVFD_CFLAGS = @LIBUSB_CFLAGS@ $(AM_CFLAGS)
ula200_CFLAGS = @LIBFTDI_CFLAGS@ $(AM_CFLAGS)
xosd_CFLAGS = @LIBXOSD_CFLAGS@ $(AM_CFLAGS)
@@ -63,7 +63,7 @@ mtc_s16209x_LDADD = libLCD.a
MtxOrb_LDADD = libLCD.a libbignum.a
mx5000_LDADD = @LIBMX5000@
NoritakeVFD_LDADD = libbignum.a
picolcd_LDADD = @LIBUSB_LIBS@ libLCD.a libbignum.a
picolcd_LDADD = @LIBUSB_LIBS@ @LIBUSB_1_0_LIBS@ libLCD.a libbignum.a
pyramid_LDADD = libLCD.a libbignum.a
serialPOS_LDADD = libbignum.a
serialVFD_LDADD = libLCD.a libbignum.a
+751 -270
View File
File diff suppressed because it is too large Load Diff
+12 -1
View File
@@ -14,6 +14,14 @@
#ifndef PICOLCD_H
#define PCIOLCD_H
#ifdef HAVE_LIBUSB_1_0
# include <libusb.h>
# define USB_DEVICE_HANDLE libusb_device_handle
#else
# include <usb.h>
# define USB_DEVICE_HANDLE usb_dev_handle
#endif
/* 12 keys plus a 0 placeholder */
#define KEYPAD_MAX 13
#define KEYPAD_LIGHTS 8
@@ -34,7 +42,10 @@
#define DEFAULT_OFFBRIGHTNESS 0 /* Off */
#define DEFAULT_BACKLIGHT 1 /* On */
#define DEFAULT_KEYLIGHTS 1 /* On */
#define DEFAULT_LINKLIGHTS 1 /* On */
#define DEFAULT_TIMEOUT 500 /* Half second */
#define DEFAULT_REPEAT_DELAY 300 /* milliseconds */
#define DEFAULT_REPEAT_INTERVAL 200 /* milliseconds */
typedef struct _lcd_packet {
@@ -56,7 +67,7 @@ typedef struct _picolcd_device {
int width; /* width of lcd screen */
int height; /* height of lcd screen */
/* Pointer to function that writes data to the LCD format */
void (*write) (usb_dev_handle *lcd, const int row, const int col, const unsigned char *data);
void (*write) (USB_DEVICE_HANDLE *lcd, const int row, const int col, const unsigned char *data);
/* Pointer to function that defines a custom character */
void (*cchar) (Driver *drvthis, int n, unsigned char *dat);
} picolcd_device;