diff --git a/armsrc/appmain.c b/armsrc/appmain.c index fc7533778..f7c91fc5e 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1134,9 +1134,6 @@ void __attribute__((noreturn)) AppMain(void) { LEDsoff(); - // Init USB device - usb_enable(); - // The FPGA gets its clock from us from PCK0 output, so set that up. AT91C_BASE_PIOA->PIO_BSR = GPIO_PCK0; AT91C_BASE_PIOA->PIO_PDR = GPIO_PCK0; @@ -1155,6 +1152,9 @@ void __attribute__((noreturn)) AppMain(void) { FpgaDownloadAndGo(FPGA_BITSTREAM_HF); StartTickCount(); + + // Init USB device + usb_enable(); #ifdef WITH_LCD LCDInit(); diff --git a/bootrom/bootrom.c b/bootrom/bootrom.c index 302916476..7796a304a 100644 --- a/bootrom/bootrom.c +++ b/bootrom/bootrom.c @@ -191,7 +191,6 @@ static void flash_mode(int externally_entered) { end_addr = 0; bootrom_unlocked = 0; byte_t rx[sizeof(UsbCommand)]; - //size_t rx_len; usb_enable(); //for (volatile size_t i=0; i<0x100000; i++) {}; @@ -203,12 +202,6 @@ static void flash_mode(int externally_entered) { if ( cmd_receive( (UsbCommand*)rx ) ) UsbPacketReceived(rx, sizeof(UsbCommand) ); - // if ( usb_poll_validate_length()) { - // rx_len = usb_read(rx, sizeof(UsbCommand)); - // if (rx_len) - // UsbPacketReceived(rx, rx_len); - //} - if (!externally_entered && !BUTTON_PRESS()) { /* Perform a reset to leave flash mode */ usb_disable();