]> git.zerfleddert.de Git - usb-driver/commitdiff
reset the USB cable when /dev/windrvr6 is closed.
authorMichael Gernoth <michael@gernoth.net>
Thu, 10 Apr 2008 18:25:53 +0000 (20:25 +0200)
committerMichael Gernoth <michael@gernoth.net>
Thu, 10 Apr 2008 18:25:53 +0000 (20:25 +0200)
This should solve prolems when impact fails on second use.

Makefile
usb-driver.c

index 8a21424b618591ebc47bc0b3e224556f865a1633..1575da5b3ea4724dcabbcb066cae68e2debb2e3c 100644 (file)
--- a/Makefile
+++ b/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
 
index def52dbf587cf7115f6ed679aab59d5a6cb03280..6320b9f74fe4bee537b735ca49700dcb317797e0 100644 (file)
@@ -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;
Impressum, Datenschutz