diff --git a/hardwaresetup.cpp b/hardwaresetup.cpp index 3d56d15..d77844a 100644 --- a/hardwaresetup.cpp +++ b/hardwaresetup.cpp @@ -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); + } + } } } }