diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-12-03 19:47:07 +0100 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-12-03 19:47:07 +0100 |
commit | 229fd5405eef950e60cae3b6f446c146f38a2e13 (patch) | |
tree | 0a56019dba85afb26992fc140bbc0e8eeea262ff /hal/rcc.cpp | |
parent | 5b6df900dd63f7a2022c899aee9dc13fd82a1e5c (diff) |
Moved FLASH and RCC register definitions into own headers.
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)); |