From: Keith Packard Date: Mon, 26 Jul 2010 19:52:17 +0000 (-0700) Subject: When the EP0 IN buffer is full, don't panic, just skip sending another X-Git-Tag: debian/0.6+268+gd0fd53b~14 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=05111d5be4d37bedaaee6415d6ee27347e6a112c;ds=sidebyside When the EP0 IN buffer is full, don't panic, just skip sending another If the host doesn't pull the IN packet out of EP0 before sending another SETUP command along, the IN buffer will still be busy when we try to reply to the SETUP command. While I don't quite understand why this would ever happen, there's no need to panic about it, just drop the reply packet on the floor. Signed-off-by: Keith Packard --- diff --git a/src/ao_usb.c b/src/ao_usb.c index d071fe6f..f6e0fcf9 100644 --- a/src/ao_usb.c +++ b/src/ao_usb.c @@ -82,10 +82,11 @@ ao_usb_ep0_flush(void) __xdata uint8_t this_len; __xdata uint8_t cs0; + /* If the IN packet hasn't been picked up, just return */ USBINDEX = 0; cs0 = USBCS0; if (cs0 & USBCS0_INPKT_RDY) - ao_panic(AO_PANIC_USB); + return; this_len = ao_usb_ep0_in_len; if (this_len > AO_USB_CONTROL_SIZE)