USB: implement USB reset by setting the on-board pull-up on D+ low

This commit is contained in:
Kévin Redon
2018-06-17 22:31:21 +02:00
committed by Harald Welte
parent 4136c242a8
commit f5869d4a59
3 changed files with 18 additions and 7 deletions

View File

@@ -194,6 +194,12 @@ extern int main(void)
board_main_top();
TRACE_INFO("USB init...\n\r");
/* Signal USB reset by disabling the pull-up on USB D+ for at least 10 ms */
const Pin usb_dp_pullup = PIN_USB_PULLUP;
PIO_Configure(&usb_dp_pullup, 1);
PIO_Set(&usb_dp_pullup);
mdelay(15);
PIO_Clear(&usb_dp_pullup);
USBDFU_Initialize(&dfu_descriptors);
while (USBD_GetState() < USBD_STATE_CONFIGURED) {