mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-25 18:57:11 +02:00
tools/lib/misctxrx.c (wait_for_interrupt): enforce a minimum timeout of 10 ms
Seems that just one millisecond isn't enough to get a byte from the USB device, even if the byte is already waiting in the endpoint FIFO there.
This commit is contained in:
parent
8a2d80a93c
commit
d8363d853c
@ -24,6 +24,9 @@
|
||||
#include "misctxrx.h"
|
||||
|
||||
|
||||
#define MIN_TIMEOUT_MS 10
|
||||
|
||||
|
||||
/* ----- Interrupts -------------------------------------------------------- */
|
||||
|
||||
|
||||
@ -59,8 +62,11 @@ uint8_t wait_for_interrupt(struct atrf_dsc *dsc, uint8_t wait_for,
|
||||
|
||||
sigint = 0;
|
||||
old_sig = signal(SIGINT, die);
|
||||
if (timeout_ms)
|
||||
if (timeout_ms) {
|
||||
if (timeout_ms < MIN_TIMEOUT_MS)
|
||||
timeout_ms = MIN_TIMEOUT_MS;
|
||||
timeout_start(&to, timeout_ms);
|
||||
}
|
||||
while (!sigint && !timedout) {
|
||||
while (!sigint && !timedout) {
|
||||
if (timeout_ms) {
|
||||
|
Loading…
Reference in New Issue
Block a user