From: Michael Gernoth Date: Thu, 10 Apr 2008 18:25:53 +0000 (+0200) Subject: reset the USB cable when /dev/windrvr6 is closed. X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/usb-driver/commitdiff_plain/bbc3baea9be197558fd77397ce34f22faea76ea1 reset the USB cable when /dev/windrvr6 is closed. This should solve prolems when impact fails on second use. --- diff --git a/Makefile b/Makefile index 8a21424..1575da5 100644 --- 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 diff --git a/usb-driver.c b/usb-driver.c index def52db..6320b9f 100644 --- a/usb-driver.c +++ b/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;