Date:2011-07-13 20:03:28 (8 years 3 months ago)
Author:Werner Almesberger
Commit:8f8c4140ac58d5148f2806ed930a63e79a642e7c
Message:tools/lib/atusb-common.c (atusb_tx): wait for and receive the TX completion

Files: tools/lib/atusb-common.c (2 diffs)

Change Details

tools/lib/atusb-common.c
341341void atusb_tx(void *handle, const void *buf, int size)
342342{
343343    struct atusb_dsc *dsc = handle;
344    uint8_t tmp;
344345    int res;
345346
346347    if (dsc->error)
...... 
352353        fprintf(stderr, "ATUSB_TX: %d\n", res);
353354        dsc->error = 1;
354355    }
356    res = usb_bulk_read(dsc->dev, 1, (char *) &tmp, 1, 0);
357    if (res < 0) {
358        fprintf(stderr, "usb_bulk_read: %d\n", res);
359        dsc->error = 1;
360        return 0;
361    }
362    if (tmp)
363        fprintf(stderr, "atusb_tx: ACK is non-zero 0x%02x\n", tmp);
355364}
356365
357366

Archive Download the corresponding diff file



interactive