From cdee435f8bfde343386ca2a1209ecaa81cd991c2 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Mon, 22 Sep 2014 10:01:39 +0000 Subject: [PATCH] bug #43268: usb_drain() call causes LUFA AVR-ISP MKII Code to Fail * usb_libusb.c (usbdev_drain): Make this a dummy function only. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1334 81a1dc3b-b13d-400b-aceb-764788c761c2 --- ChangeLog | 5 +++++ usb_libusb.c | 25 ++++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1a97312..57d0fe3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-09-22 Joerg Wunsch + + bug #43268: usb_drain() call causes LUFA AVR-ISP MKII Code to Fail + * usb_libusb.c (usbdev_drain): Make this a dummy function only. + 2014-08-19 Rene Liebscher patch #7694 Add support for the atmega32m1 diff --git a/usb_libusb.c b/usb_libusb.c index eac99296..ff1f6b92 100644 --- a/usb_libusb.c +++ b/usb_libusb.c @@ -565,21 +565,16 @@ static int usbdev_recv_frame(union filedescriptor *fd, unsigned char *buf, size_ static int usbdev_drain(union filedescriptor *fd, int display) { - usb_dev_handle *udev = (usb_dev_handle *)fd->usb.handle; - int rv; - - if (udev == NULL) - return -1; - - do { - if (fd->usb.use_interrupt_xfer) - rv = usb_interrupt_read(udev, fd->usb.rep, usbbuf, fd->usb.max_xfer, 100); - else - rv = usb_bulk_read(udev, fd->usb.rep, usbbuf, fd->usb.max_xfer, 100); - if (rv > 0) - avrdude_message(MSG_TRACE, "%s: usbdev_drain(): flushed %d characters\n", - progname, rv); - } while (rv > 0); + /* + * There is not much point in trying to flush any data + * on an USB endpoint, as the endpoint is supposed to + * start afresh after being configured from the host. + * + * As trying to flush the data here caused strange effects + * in some situations (see + * https://savannah.nongnu.org/bugs/index.php?43268 ) + * better avoid it. + */ return 0; }