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>
#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
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)