summaryrefslogtreecommitdiff
path: root/rcc/flash.cpp
blob: 528ba57ddc53a5f42e744905fbd01e241d1e5cae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "flash.h"

void flash_init() {
	#if defined(STM32F1) || defined(STM32F3)
	
	// Set flash latency.
	FLASH.ACR = 0x12;
	
	#elif defined(STM32F4)
	
	// Set flash latency.
	FLASH.ACR = 0x105;
	
	while(FLASH.ACR != 0x105);
	
	#endif
}