drivers: usb_dc_sam: free endpoint memory on End of Reset event

Free endpoint memory on End of Reset event (EORST).

Fixes: #24626

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2020-05-12 12:01:08 +02:00 committed by Carles Cufí
commit 5a3d44256e

View file

@ -256,6 +256,12 @@ static void usb_dc_isr(void)
usb_dc_ep_enable_interrupts(0);
}
/* Free all endpoint memory */
for (int idx = 1; idx < NUM_OF_EP_MAX; idx++) {
usb_dc_ep_disable(idx);
USBHS->USBHS_DEVEPTCFG[idx] &= ~USBHS_DEVEPTCFG_ALLOC;
}
/* Callback function */
dev_data.status_cb(USB_DC_RESET, NULL);
}