diff options
Diffstat (limited to 'rcc/flash.cpp')
-rw-r--r-- | rcc/flash.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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 +} |