From e586c178073b9a0fee90d5fc8e795d266ebd7b7d Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Tue, 7 Aug 2012 16:50:46 +0200 Subject: Initial import. Most sources are split off from suzumebachi project revision 2fc77d2 as is with some path changes. New build rules introduced. --- rcc/flash.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 rcc/flash.cpp (limited to 'rcc/flash.cpp') diff --git a/rcc/flash.cpp b/rcc/flash.cpp new file mode 100644 index 0000000..2b0fb69 --- /dev/null +++ b/rcc/flash.cpp @@ -0,0 +1,17 @@ +#include "flash.h" + +void flash_init() { + #if defined(STM32F1) + + // Set flash latency. + FLASH.ACR = 0x12; + + #elif defined(STM32F4) + + // Set flash latency. + FLASH.ACR = 0x105; + + while(FLASH.ACR != 0x105); + + #endif +} -- cgit v1.2.3