* usb_libusb.c (usbdev_drain): actually implement draining to aid

synchronizing against a JTAG ICE in weird state.


git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@497 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
joerg_wunsch
2005-09-16 15:01:52 +00:00
parent 29310a6f20
commit cf046b8f9d
2 changed files with 15 additions and 0 deletions

View File

@@ -259,6 +259,16 @@ static int usbdev_recv(int fd, unsigned char *buf, size_t nbytes)
static int usbdev_drain(int fd, int display)
{
usb_dev_handle *udev = (usb_dev_handle *)fd;
int rv;
do {
rv = usb_bulk_read(udev, JTAGICE_BULK_EP, usbbuf, JTAGICE_MAX_XFER, 100);
if (rv > 0 && verbose >= 4)
fprintf(stderr, "%s: usbdev_drain(): flushed %d characters\n",
progname, rv);
} while (rv > 0);
return 0;
}