mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
System clock config cleanup.
* Use HAL_PWREx_ConfigSupply to enable LDO. * Use __HAL_PWR_GET_FLAG to check for VOSRDY.
This commit is contained in:
parent
50da3c824a
commit
2bb8b2d917
@ -180,7 +180,7 @@ void SystemClock_Config(void)
|
|||||||
|
|
||||||
#if defined(MCU_SERIES_H7)
|
#if defined(MCU_SERIES_H7)
|
||||||
/* Supply configuration update enable */
|
/* Supply configuration update enable */
|
||||||
MODIFY_REG(PWR->CR3, PWR_CR3_SCUEN, 0);
|
HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);
|
||||||
#else
|
#else
|
||||||
/* Enable Power Control clock */
|
/* Enable Power Control clock */
|
||||||
__PWR_CLK_ENABLE();
|
__PWR_CLK_ENABLE();
|
||||||
@ -201,11 +201,8 @@ void SystemClock_Config(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Wait for PWR_FLAG_VOSRDY
|
// Wait for PWR_FLAG_VOSRDY
|
||||||
#if defined(MCU_SERIES_F4) || defined(MCU_SERIES_F7)
|
#if defined(MCU_SERIES_H7)
|
||||||
//while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {
|
while (__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY) == RESET) {
|
||||||
//}
|
|
||||||
#elif defined(MCU_SERIES_H7)
|
|
||||||
while ((PWR->D3CR & (PWR_D3CR_VOSRDY)) != PWR_D3CR_VOSRDY) {
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user