[LL][USB] Increase timeout value to allow core reset to complete
diff --git a/Inc/stm32f1xx_ll_usb.h b/Inc/stm32f1xx_ll_usb.h index c3a548e..f6f7e77 100644 --- a/Inc/stm32f1xx_ll_usb.h +++ b/Inc/stm32f1xx_ll_usb.h
@@ -37,6 +37,9 @@ */ /* Exported types ------------------------------------------------------------*/ +#ifndef HAL_USB_TIMEOUT +#define HAL_USB_TIMEOUT 0xF000000U +#endif /* define HAL_USB_TIMEOUT */ /** * @brief USB Mode definition
diff --git a/Src/stm32f1xx_ll_usb.c b/Src/stm32f1xx_ll_usb.c index a25f305..6ce84ac 100644 --- a/Src/stm32f1xx_ll_usb.c +++ b/Src/stm32f1xx_ll_usb.c
@@ -383,7 +383,7 @@ { count++; - if (count > 200000U) + if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } @@ -397,7 +397,7 @@ { count++; - if (count > 200000U) + if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } @@ -420,7 +420,7 @@ { count++; - if (count > 200000U) + if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } @@ -434,7 +434,7 @@ { count++; - if (count > 200000U) + if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } @@ -1254,7 +1254,7 @@ { count++; - if (count > 200000U) + if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; } @@ -1268,7 +1268,7 @@ { count++; - if (count > 200000U) + if (count > HAL_USB_TIMEOUT) { return HAL_TIMEOUT; }