fix usb_reset. sharing the cable between applications is still possible.
This commit is contained in:
parent
cf55ed64bb
commit
adb51cf1e7
4
Makefile
4
Makefile
@ -1,7 +1,7 @@
|
|||||||
#Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of
|
#Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of
|
||||||
#a Parallel Cable III
|
#a Parallel Cable III
|
||||||
#Add -DNO_USB_RESET to disable the hard reset of the cable on
|
#Add -DNO_USB_RESET to disable the hard reset of the cable when
|
||||||
#close of the device
|
#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
|
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
|
LIBS=-ldl -lusb -lpthread
|
||||||
|
@ -450,8 +450,15 @@ static int do_wdioctl(int fd, unsigned int request, unsigned char *wdioctl) {
|
|||||||
ret = (*ioctl_func) (fd, request, wdioctl);
|
ret = (*ioctl_func) (fd, request, wdioctl);
|
||||||
#else
|
#else
|
||||||
if (usbdevice) {
|
if (usbdevice) {
|
||||||
if (!usb_devhandle)
|
if (!usb_devhandle) {
|
||||||
usb_devhandle = usb_open(usbdevice);
|
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;
|
usbinterface = usbdevice->config[0].interface[usi->dwInterfaceNum].altsetting[usi->dwAlternateSetting].bInterfaceNumber;
|
||||||
usbalternate = usi->dwAlternateSetting;
|
usbalternate = usi->dwAlternateSetting;
|
||||||
|
Reference in New Issue
Block a user