IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2011-06-21 03:56:59 (12 years 9 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | cb20c55231b9c6c7bc0a2f22a35460a31f7a77db |
Message: | tools/lib/misctxrx.c (wait_for_interrupt): don't fragment timeouts usb_bulk_read may lose data when timing out. We therefore try to minimize the number of times we time out. |
Files: |
tools/lib/misctxrx.c (2 diffs) |
Change Details
tools/lib/misctxrx.c | ||
---|---|---|
24 | 24 | #include "misctxrx.h" |
25 | 25 | |
26 | 26 | |
27 | #define MAX_WAIT_MS 100 /* make sure we respond to ^C */ | |
28 | ||
29 | ||
30 | 27 | /* ----- Interrupts -------------------------------------------------------- */ |
31 | 28 | |
32 | 29 | |
... | ... | |
68 | 65 | while (!sigint && !timedout) { |
69 | 66 | if (timeout_ms) { |
70 | 67 | ms = timeout_left_ms(&to); |
71 | if (ms > 0) { | |
72 | if (ms > MAX_WAIT_MS) | |
73 | ms = MAX_WAIT_MS; | |
74 | } else { | |
68 | if (ms <= 0) { | |
75 | 69 | timedout = 1; |
76 | 70 | ms = 1; |
77 | 71 | } |
78 | 72 | } else { |
79 | ms = MAX_WAIT_MS; | |
73 | ms = 0; | |
80 | 74 | } |
81 | 75 | irq = atrf_interrupt_wait(dsc, ms); |
82 | 76 | if (irq) |