From c5730cf711aaec8f8fe46d35f66340cccd3a5f9b Mon Sep 17 00:00:00 2001 From: etagle Date: Thu, 22 Mar 2018 03:31:25 -0300 Subject: [PATCH] As Bob-The-Khun suggested, resetting the USB peripheral solves the huge startup delays that happen when a WDT reset happens and we are connected through the native port --- Marlin/src/HAL/HAL_DUE/usb/usb_task.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/src/HAL/HAL_DUE/usb/usb_task.c b/Marlin/src/HAL/HAL_DUE/usb/usb_task.c index 468385b508..528db591c3 100644 --- a/Marlin/src/HAL/HAL_DUE/usb/usb_task.c +++ b/Marlin/src/HAL/HAL_DUE/usb/usb_task.c @@ -301,7 +301,11 @@ void usb_task_init(void) { uint16_t *ptr; + // Disable USB peripheral so we start clean and avoid lockups + otg_disable(); udd_disable(); + + // Set the USB interrupt to our stack UDD_SetStack(&USBD_ISR); // Start USB stack to authorize VBus monitoring