Update number of Flash wait states in line with MSI range and current voltage range.
1719 uint32_t latency = FLASH_LATENCY_0;
1721 if(__HAL_RCC_PWR_IS_CLK_ENABLED())
1727 __HAL_RCC_PWR_CLK_ENABLE();
1729 __HAL_RCC_PWR_CLK_DISABLE();
1732 if(vos == PWR_REGULATOR_VOLTAGE_SCALE1)
1734 if(msirange > RCC_MSIRANGE_8)
1737 if(msirange > RCC_MSIRANGE_10)
1740 latency = FLASH_LATENCY_2;
1745 latency = FLASH_LATENCY_1;
1752 #if defined(STM32L4R5xx) || defined(STM32L4R7xx) || defined(STM32L4R9xx) || defined(STM32L4S5xx) || defined(STM32L4S7xx) || defined(STM32L4S9xx) 1753 if(msirange >= RCC_MSIRANGE_8)
1756 latency = FLASH_LATENCY_2;
1760 if(msirange == RCC_MSIRANGE_7)
1763 latency = FLASH_LATENCY_1;
1768 if(msirange > RCC_MSIRANGE_8)
1771 latency = FLASH_LATENCY_3;
1775 if(msirange == RCC_MSIRANGE_8)
1778 latency = FLASH_LATENCY_2;
1780 else if(msirange == RCC_MSIRANGE_7)
1783 latency = FLASH_LATENCY_1;
1790 __HAL_FLASH_SET_LATENCY(latency);
1794 if(__HAL_FLASH_GET_LATENCY() != latency)
uint32_t HAL_PWREx_GetVoltageRange(void)
Return Voltage Scaling Range.