From 33aec0876b4f8f99f1ce500983689a78e5c9daf5 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Tue, 2 Apr 2019 16:39:13 +0800 Subject: [PATCH] sw: usb-epfifo: disable usb events before disconnect If we don't disconnect the usb event system, then we will lock up in an irq storm. Signed-off-by: Sean Cross --- sw/src/usb-epfifo.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sw/src/usb-epfifo.c b/sw/src/usb-epfifo.c index 4d1af1a..771ddca 100644 --- a/sw/src/usb-epfifo.c +++ b/sw/src/usb-epfifo.c @@ -41,6 +41,9 @@ enum epfifo_response { #define USB_EV_PACKET 2 void usb_disconnect(void) { + usb_ep_0_out_ev_enable_write(0); + usb_ep_0_in_ev_enable_write(0); + irq_setmask(irq_getmask() & ~(1 << USB_INTERRUPT)); usb_pullup_out_write(0); }