stm32f234: flash: Add FLASH_ACR_LATENCY_MASK

This commit is contained in:
Jordi Pakey-Rodriguez 2017-03-06 16:10:02 -06:00 committed by Karl Palsson
parent 6798cee2a5
commit 90d8bd6753
2 changed files with 2 additions and 1 deletions

View File

@ -50,6 +50,7 @@
/* --- FLASH_ACR values ---------------------------------------------------- */
#define FLASH_ACR_LATENCY_MASK 0x07
#define FLASH_ACR_LATENCY_0WS 0x00
#define FLASH_ACR_LATENCY_1WS 0x01
#define FLASH_ACR_LATENCY_2WS 0x02

View File

@ -41,7 +41,7 @@ void flash_set_ws(uint32_t ws)
uint32_t reg32;
reg32 = FLASH_ACR;
reg32 &= ~((1 << 0) | (1 << 1) | (1 << 2));
reg32 &= ~(FLASH_ACR_LATENCY_MASK);
reg32 |= ws;
FLASH_ACR = reg32;
}