stm32: flash: pull set_ws up to common code

All that changes is the size of the field.
This commit is contained in:
Karl Palsson
2018-07-13 23:33:16 +00:00
parent 4840b6bc7e
commit 2bf7eb4a0c
11 changed files with 25 additions and 101 deletions

View File

@@ -33,5 +33,16 @@ void flash_prefetch_disable(void)
FLASH_ACR &= ~FLASH_ACR_PRFTEN;
}
void flash_set_ws(uint32_t ws)
{
uint32_t reg32;
reg32 = FLASH_ACR;
reg32 &= ~(FLASH_ACR_LATENCY_MASK << FLASH_ACR_LATENCY_SHIFT);
reg32 |= (ws << FLASH_ACR_LATENCY_SHIFT);
FLASH_ACR = reg32;
}
/*@}*/