1
0

fix usb_reset. sharing the cable between applications is still possible.

This commit is contained in:
Michael Gernoth 2008-04-10 22:21:21 +02:00
parent cf55ed64bb
commit adb51cf1e7
2 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,7 @@
#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

View File

@ -450,8 +450,15 @@ static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
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;