}
}
+static void my_msleep(int ms)
+{
+ struct timespec ts = { .tv_sec = ms/1000, .tv_nsec = (ms%1000) * 1000000 };
+ nanosleep(&ts, NULL);
+}
+
static int send_and_receive(byte *req, byte *reply)
{
if (debug_packets) {
log_pkt(">> xmit %d bytes\n", transferred);
dump_packet(req);
}
+ my_msleep(1);
if (err = libusb_bulk_transfer(devh, rx_endpoint, reply, 64, &transferred, 200)) {
if (err == LIBUSB_ERROR_TIMEOUT) {
log_pkt("<< recv timed out\n");
static void interruptible_msleep(int ms)
{
sigprocmask(SIG_UNBLOCK, &term_sigs, NULL);
- struct timespec ts = { .tv_sec = ms/1000, .tv_nsec = (ms%1000) * 1000000 };
- nanosleep(&ts, NULL);
+ my_msleep(ms);
sigprocmask(SIG_BLOCK, &term_sigs, NULL);
}