From d60d9baaa2cf2cb36b24f2e8ed83b9e28589c7b0 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Wed, 29 May 2013 23:22:33 +0200 Subject: [PATCH] add delays to stop device from resetting --- hmcfgusb.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.5