From 267923e56e22b3635a21f42ef77a3a36158bc273 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 16 Jun 2010 21:49:43 -0700 Subject: [PATCH] Add special code for USB panic's. The USB system may panic if the hardware isn't ready for IN data when the driver thinks it should be. This adds a special panic code to make figuring this out easier. Signed-off-by: Keith Packard --- src/ao.h | 1 + src/ao_usb.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ao.h b/src/ao.h index 97cb75ae..a2dfadd0 100644 --- a/src/ao.h +++ b/src/ao.h @@ -110,6 +110,7 @@ ao_start_scheduler(void); #define AO_PANIC_STDIO 7 /* Too many stdio handlers registered */ #define AO_PANIC_REBOOT 8 /* Reboot failed */ #define AO_PANIC_FLASH 9 /* Invalid flash part (or wrong blocksize) */ +#define AO_PANIC_USB 10 /* Trying to send USB packet while busy */ /* Stop the operating system, beeping and blinking the reason */ void diff --git a/src/ao_usb.c b/src/ao_usb.c index e4af8e45..d071fe6f 100644 --- a/src/ao_usb.c +++ b/src/ao_usb.c @@ -85,7 +85,7 @@ ao_usb_ep0_flush(void) USBINDEX = 0; cs0 = USBCS0; if (cs0 & USBCS0_INPKT_RDY) - ao_panic(0); + ao_panic(AO_PANIC_USB); this_len = ao_usb_ep0_in_len; if (this_len > AO_USB_CONTROL_SIZE) -- 2.30.2