Merge pull request #616 from openmv/pwr_fixes

Pwr fixes
This commit is contained in:
Ibrahim Abd Elkader 2019-10-22 15:51:25 +02:00 committed by GitHub
commit 1915b9142f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 7 deletions

View File

@ -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();
@ -192,6 +192,7 @@ void SystemClock_Config(void)
#if defined(MCU_SERIES_H7) #if defined(MCU_SERIES_H7)
// Enable VSCALE0 for revision V devices. // Enable VSCALE0 for revision V devices.
if (HAL_GetREVID() >= 0x2003) { if (HAL_GetREVID() >= 0x2003) {
__HAL_RCC_SYSCFG_CLK_ENABLE();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);
} else { } else {
#else #else
@ -201,11 +202,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

@ -1 +1 @@
Subproject commit dac67f735da2fc2138a76947936521ffe914b8f4 Subproject commit 00069f12cf48d12f6a84c242cc33966008637dfa