Browse Source

reset the USB cable when /dev/windrvr6 is closed.

This should solve prolems when impact fails on second use.
master
Michael Gernoth 17 years ago
parent
commit
bbc3baea9b
  1. 4
      Makefile
  2. 6
      usb-driver.c

4
Makefile

@ -1,6 +1,8 @@
#Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of
#a Parallel Cable III
CFLAGS=-Wall -fPIC -DUSB_DRIVER_VERSION="\"$(shell stat -c '%y' usb-driver.c |cut -d\. -f1)\"" #-DFORCE_PC3_IDENT
#Add -DNO_USB_RESET to disable the hard reset of the cable on
#close of the device
CFLAGS=-Wall -fPIC -DUSB_DRIVER_VERSION="\"$(shell stat -c '%y' usb-driver.c |cut -d\. -f1)\"" #-DFORCE_PC3_IDENT -DNO_USB_RESET
LIBS=-ldl -lusb -lpthread

6
usb-driver.c

@ -830,8 +830,12 @@ int close(int fd) {
if (usbinterface >= 0)
usb_release_interface(usb_devhandle, usbinterface);
if (usb_devhandle)
if (usb_devhandle) {
#ifndef NO_USB_RESET
usb_reset(usb_devhandle);
#endif
usb_close(usb_devhandle);
}
usb_devhandle = NULL;
usbinterface = -1;

Loading…
Cancel
Save