Merge pull request #424 from BlackBrix-Editor/16MHz-crystal-option
Added support inside the Core, for boards which have a 16Mhz crystal using '#define XTAL16M'. Note, no variants or boards.txt changes have been added to use this feature,
This commit is contained in:
commit
e01a70b040
|
@ -130,6 +130,12 @@ static void setup_clocks(void) {
|
|||
wirish::priv::board_setup_clock_prescalers();
|
||||
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.
|
||||
rcc_turn_on_clk(RCC_CLK_PLL);
|
||||
while(!rcc_is_clk_ready(RCC_CLK_PLL))
|
||||
|
|
Loading…
Reference in New Issue