From 3d8c093cb222f251e77af58a0bf9a22e7fba1545 Mon Sep 17 00:00:00 2001 From: Christina Quast Date: Wed, 24 Jun 2015 16:00:13 +0200 Subject: [PATCH] main: Increase timeout for USB configured state When the timeout was too small, the main function would infinitely loop around, restarting the board and waiting for the USB interface to get configured. But since configuration seems to take more than one second, it rarely succeeded. Increasing the timeout makes the USB configuration finish in the first try. --- firmware/src_simtrace/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/src_simtrace/main.c b/firmware/src_simtrace/main.c index dbe5e469..afb82f3e 100644 --- a/firmware/src_simtrace/main.c +++ b/firmware/src_simtrace/main.c @@ -51,7 +51,7 @@ extern int main( void ) printf("%s", "USB init\n\r"); while(USBD_GetState() < USBD_STATE_CONFIGURED){ - if(i >= MAX_USB_ITER) { + if(i >= MAX_USB_ITER*3) { TRACE_ERROR("Resetting board (USB could not be configured)\n"); NVIC_SystemReset(); }