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 <sean@xobs.io>
This commit is contained in:
Sean Cross 2019-04-02 16:39:13 +08:00
parent 8599ec7007
commit 33aec0876b

View File

@ -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);
}