From f3e5111cff8d9f91dd5279df5165c386d77fed2e Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 23 Apr 2012 13:45:15 -0400 Subject: stm32f1 boards_setup.cpp: Allow overriding the PLL multiplier. Allow to override the PLL multiplier by defining BOARD_RCC_PLLMUL. This should be useful for e.g. value line MCUs, which have slower clocks. It's also probably useful for people who have external oscillators different from the 8 MHz ones we use on all of our boards. Signed-off-by: Marti Bolivar --- wirish/stm32f1/boards_setup.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'wirish/stm32f1/boards_setup.cpp') diff --git a/wirish/stm32f1/boards_setup.cpp b/wirish/stm32f1/boards_setup.cpp index 8e16009..74c0e79 100644 --- a/wirish/stm32f1/boards_setup.cpp +++ b/wirish/stm32f1/boards_setup.cpp @@ -42,13 +42,22 @@ #include +// Allow boards to provide a PLL multiplier. This is useful for +// e.g. STM32F100 value line MCUs, which use slower multipliers. +// (We're leaving the default to RCC_PLLMUL_9 for now, since that +// works for F103 performance line MCUs, which is all that LeafLabs +// currently officially supports). +#ifndef BOARD_RCC_PLLMUL +#define BOARD_RCC_PLLMUL RCC_PLLMUL_9 +#endif + /* FIXME: Reintroduce all "#if 0"'ed blocks once libmaple provides * these definitions again. */ namespace wirish { namespace priv { - static stm32f1_rcc_pll_data pll_data = {RCC_PLLMUL_9}; + static stm32f1_rcc_pll_data pll_data = {BOARD_RCC_PLLMUL}; rcc_pll_cfg w_board_pll_cfg = {RCC_PLLSRC_HSE, &pll_data}; adc_prescaler w_adc_pre = ADC_PRE_PCLK2_DIV_6; adc_smp_rate w_adc_smp = ADC_SMPR_55_5; -- cgit v1.2.3