#Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of
#a Parallel Cable III
-#Add -DNO_USB_RESET to disable the hard reset of the cable on
-#close of the device
+#Add -DNO_USB_RESET to disable the hard reset of the cable when
+#opening 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
ret = (*ioctl_func) (fd, request, wdioctl);
#else
if (usbdevice) {
- if (!usb_devhandle)
+ if (!usb_devhandle) {
usb_devhandle = usb_open(usbdevice);
+#ifndef NO_USB_RESET
+ if (usb_devhandle) {
+ usb_reset(usb_devhandle);
+ usb_devhandle = usb_open(usbdevice);
+ }
+#endif
+ }
usbinterface = usbdevice->config[0].interface[usi->dwInterfaceNum].altsetting[usi->dwAlternateSetting].bInterfaceNumber;
usbalternate = usi->dwAlternateSetting;