From 05111d5be4d37bedaaee6415d6ee27347e6a112c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 26 Jul 2010 12:52:17 -0700 Subject: [PATCH] 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 --- src/ao_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.30.2