option XTAL16M for boards with 16MHz-crystal
tested on STM32F103VE only but surely can be used on other STM32F103xC, STM32F103xD, STM32F103xE with the same clock PLL structure
This commit is contained in:
parent
98fdd47203
commit
8540c6b08b
|
@ -130,6 +130,12 @@ static void setup_clocks(void) {
|
||||||
wirish::priv::board_setup_clock_prescalers();
|
wirish::priv::board_setup_clock_prescalers();
|
||||||
rcc_configure_pll(&wirish::priv::w_board_pll_cfg);
|
rcc_configure_pll(&wirish::priv::w_board_pll_cfg);
|
||||||
|
|
||||||
|
#ifdef XTAL16M
|
||||||
|
// 16MHz crystal (HSE)
|
||||||
|
// in this case we additionally set the Bit 17 (PLLXTPRE=1) => then HSE clock is divided by 2 before PLL entry
|
||||||
|
RCC_BASE->CFGR |= RCC_CFGR_PLLXTPRE;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Enable the PLL, and wait until it's ready.
|
// Enable the PLL, and wait until it's ready.
|
||||||
rcc_turn_on_clk(RCC_CLK_PLL);
|
rcc_turn_on_clk(RCC_CLK_PLL);
|
||||||
while(!rcc_is_clk_ready(RCC_CLK_PLL))
|
while(!rcc_is_clk_ready(RCC_CLK_PLL))
|
||||||
|
|
Loading…
Reference in New Issue