Skip to content

Commit

Permalink
drivers: usb_dc_sam: free endpoint memory on End of Reset event
Browse files Browse the repository at this point in the history
Free endpoint memory on End of Reset event (EORST).

Fixes: zephyrproject-rtos#24626

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
  • Loading branch information
jfischer-no authored and hakehuang committed Jun 20, 2020
1 parent 32b9f84 commit 5089457
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/usb/device/usb_dc_sam.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5089457

Please sign in to comment.