stmhal: Port of f4 hal commit c568a2b
to f7 hal
This commit is contained in:
parent
9e8eba797e
commit
af9d885f8c
|
@ -981,7 +981,12 @@ uint32_t HAL_RCC_GetSysClockFreq(void)
|
||||||
if (__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLCFGR_PLLSRC_HSI)
|
if (__HAL_RCC_GET_PLL_OSCSOURCE() != RCC_PLLCFGR_PLLSRC_HSI)
|
||||||
{
|
{
|
||||||
/* HSE used as PLL clock source */
|
/* HSE used as PLL clock source */
|
||||||
pllvco = ((HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN)));
|
//pllvco = ((HSE_VALUE / pllm) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN)));
|
||||||
|
// dpgeorge: Adjust the way the arithmetic is done so it retains
|
||||||
|
// precision for the case that pllm doesn't evenly divide HSE_VALUE.
|
||||||
|
// Must be sure not to overflow, so divide by 4 first. HSE_VALUE
|
||||||
|
// should be a multiple of 4 (being a multiple of 100 is enough).
|
||||||
|
pllvco = ((HSE_VALUE / 4) * ((RCC->PLLCFGR & RCC_PLLCFGR_PLLN) >> POSITION_VAL(RCC_PLLCFGR_PLLN))) / pllm * 4;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue