mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user