1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

tools/lib/: aggressive polling for wait_for_interrupt, if timeout_ms = -1

This commit is contained in:
Werner Almesberger
2013-07-30 19:59:11 -03:00
parent 7fd9044d94
commit 07b1da29ec
4 changed files with 19 additions and 9 deletions

View File

@@ -221,7 +221,7 @@ int atusb_interrupt_wait(void *handle, int timeout_ms)
return 0;
res = usb_bulk_read(dsc->dev, 1,
(char *) &buf, sizeof(buf), timeout_ms);
(char *) &buf, sizeof(buf), timeout_ms < 0 : 0 : timeout_ms);
if (res == -ETIMEDOUT)
return 0;
if (res < 0) {