Date:2011-06-21 03:56:59 (8 years 4 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
2424#include "misctxrx.h"
2525
2626
27#define MAX_WAIT_MS 100 /* make sure we respond to ^C */
28
29
3027/* ----- Interrupts -------------------------------------------------------- */
3128
3229
...... 
6865        while (!sigint && !timedout) {
6966            if (timeout_ms) {
7067                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) {
7569                    timedout = 1;
7670                    ms = 1;
7771                }
7872            } else {
79                ms = MAX_WAIT_MS;
73                ms = 0;
8074            }
8175            irq = atrf_interrupt_wait(dsc, ms);
8276            if (irq)

Archive Download the corresponding diff file



interactive