From: Michael Gernoth Date: Wed, 29 May 2013 21:22:33 +0000 (+0200) Subject: add delays to stop device from resetting X-Git-Tag: v0.100~101 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/hmcfgusb/commitdiff_plain/d60d9baaa2cf2cb36b24f2e8ed83b9e28589c7b0?ds=sidebyside add delays to stop device from resetting --- diff --git a/hmcfgusb.c b/hmcfgusb.c index 75838fe..c3fb60b 100644 --- a/hmcfgusb.c +++ b/hmcfgusb.c @@ -152,12 +152,16 @@ int hmcfgusb_send(struct hmcfgusb_dev *usbdev, unsigned char* send_data, int len return 0; } + usleep(1000); + if (done) { err = libusb_interrupt_transfer(usbdev->usb_devh, EP_OUT, send_data, 0, &cnt, USB_TIMEOUT); if (err) { fprintf(stderr, "Can't send data: %s\n", usb_strerror(err)); return 0; } + + usleep(1000); } return 1;