added reconnect after error
This commit is contained in:
@@ -250,8 +250,18 @@ void HardwareSetup::run() {
|
||||
}
|
||||
//}
|
||||
|
||||
if (nBytes < 0)
|
||||
if (nBytes < 0) {
|
||||
fprintf(stderr, "USB error: %sn", usb_strerror());
|
||||
while (!this->handle) {
|
||||
this->handle =
|
||||
usbOpenDevice(0x16C0, "test01", 0x05DC, "USBExample");
|
||||
|
||||
if (this->handle == NULL) {
|
||||
fprintf(stderr, "Could not find USB device!\n");
|
||||
}
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user