From 229fd5405eef950e60cae3b6f446c146f38a2e13 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sat, 3 Dec 2011 19:47:07 +0100 Subject: Moved FLASH and RCC register definitions into own headers. --- hal/rcc.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'hal/rcc.cpp') 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)); -- cgit v1.2.3