diff options
Diffstat (limited to 'system_stm32f4xx.c')
-rw-r--r-- | system_stm32f4xx.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/system_stm32f4xx.c b/system_stm32f4xx.c index d00e5aa..fc979ef 100644 --- a/system_stm32f4xx.c +++ b/system_stm32f4xx.c @@ -119,7 +119,7 @@ void SystemCoreClockUpdate(void) case 0x04: /* HSE */
SystemCoreClock = HSE_VALUE;
break;
- case 0x08: /* PLL */
+ case 0x08: {/* PLL */
/* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N
SYSCLK = PLL_VCO / PLL_P */
uint32_t pllvco;
@@ -132,13 +132,12 @@ void SystemCoreClockUpdate(void) uint32_t pllp = (((RCC->PLLCFGR & RCC_PLLCFGR_PLLP) >> 16) + 1) * 2;
SystemCoreClock = pllvco / pllp;
- break;
+ break; }
default:
SystemCoreClock = HSI_VALUE;
break;
}
/* Compute HCLK frequency */
- tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
- SystemCoreClock >>= tmp;
+ SystemCoreClock >>= AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
}
|