diff options
Diffstat (limited to 'hal/rcc.cpp')
-rw-r--r-- | hal/rcc.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/hal/rcc.cpp b/hal/rcc.cpp index 5a82d62..57b8f7d 100644 --- a/hal/rcc.cpp +++ b/hal/rcc.cpp @@ -1,11 +1,11 @@ #include "rcc.h" -#include "stm32.h" +#include "flash.h" void rcc_init() { - #if defined(STM32F1) + // Initialize flash. + flash_init(); - // Set flash latency. - FLASH.ACR = 0x12; + #if defined(STM32F1) // Enable HSE. RCC.CR |= 0x10000; @@ -28,11 +28,6 @@ void rcc_init() { #elif defined(STM32F4) - // Set flash latency. - FLASH.ACR = 0x105; - - while(FLASH.ACR != 0x105); - // Enable HSE. RCC.CR |= 0x10000; while(!(RCC.CR & 0x20000)); |