Move the USB voltage level detector after all init code.

This commit is contained in:
iabdalkader 2018-03-12 16:45:03 +02:00
parent 85f06771d3
commit aca7b9e8a8

View File

@ -263,9 +263,7 @@ void SystemClock_Config(void)
}
#endif
#if defined(MCU_SERIES_H7)
HAL_PWREx_EnableUSBVoltageDetector();
#elif defined(MCU_SERIES_F4) || defined(MCU_SERIES_F7)
#if defined(MCU_SERIES_F4) || defined(MCU_SERIES_F7)
if (HAL_PWREx_EnableOverDrive() != HAL_OK) {
// Initialization Error
__fatal_error("HAL_PWREx_EnableOverDrive");
@ -305,5 +303,8 @@ void SystemClock_Config(void)
// Enables the I/O Compensation Cell
HAL_EnableCompensationCell();
// Enable the USB voltage level detector
HAL_PWREx_EnableUSBVoltageDetector();
#endif
}