Add special code for USB panic's.
authorKeith Packard <keithp@keithp.com>
Thu, 17 Jun 2010 04:49:43 +0000 (21:49 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 17 Jun 2010 04:49:43 +0000 (21:49 -0700)
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 <keithp@keithp.com>
src/ao.h
src/ao_usb.c

index 97cb75ae59ca016f7f0c953c094827c134690360..a2dfadd00fb72438f302865cc73059eabd53e9d9 100644 (file)
--- 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
index e4af8e454625c87e1457b44475a33608d4155acb..d071fe6febfa8a7a41fc9d0e658774bb337f92e2 100644 (file)
@@ -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)