Browse Source

stm32f0: rcc: Enable prefetch buffer in rcc_clock_setup_*()

Prefetch buffer makes the code execution from the Flash memory faster.

Signed-off-by: Adam Heinrich <adam@adamh.cz>
pull/835/head
Adam Heinrich 7 years ago
committed by Karl Palsson
parent
commit
e9a8c5106e
  1. 3
      lib/stm32/f0/rcc.c

3
lib/stm32/f0/rcc.c

@ -543,6 +543,7 @@ void rcc_clock_setup_in_hse_8mhz_out_48mhz(void)
rcc_set_hpre(RCC_CFGR_HPRE_NODIV);
rcc_set_ppre(RCC_CFGR_PPRE_NODIV);
flash_prefetch_buffer_enable();
flash_set_ws(FLASH_ACR_LATENCY_024_048MHZ);
/* PLL: 8MHz * 6 = 48MHz */
@ -570,6 +571,7 @@ void rcc_clock_setup_in_hsi_out_48mhz(void)
rcc_set_hpre(RCC_CFGR_HPRE_NODIV);
rcc_set_ppre(RCC_CFGR_PPRE_NODIV);
flash_prefetch_buffer_enable();
flash_set_ws(FLASH_ACR_LATENCY_024_048MHZ);
/* 8MHz * 12 / 2 = 48MHz */
@ -595,6 +597,7 @@ void rcc_clock_setup_in_hsi48_out_48mhz(void)
rcc_set_hpre(RCC_CFGR_HPRE_NODIV);
rcc_set_ppre(RCC_CFGR_PPRE_NODIV);
flash_prefetch_buffer_enable();
flash_set_ws(FLASH_ACR_LATENCY_024_048MHZ);
rcc_set_sysclk_source(RCC_HSI48);

Loading…
Cancel
Save