diff options
author | Marti Bolivar <mbolivar@leaflabs.com> | 2012-04-23 13:45:15 -0400 |
---|---|---|
committer | Marti Bolivar <mbolivar@leaflabs.com> | 2012-04-23 13:45:15 -0400 |
commit | f3e5111cff8d9f91dd5279df5165c386d77fed2e (patch) | |
tree | 25c51e2e2f7aea62b106a4ad75a52fd824654f43 | |
parent | c213a1af51dff8655d23c1b66d19533ec35b5265 (diff) | |
download | librambutan-f3e5111cff8d9f91dd5279df5165c386d77fed2e.tar.gz librambutan-f3e5111cff8d9f91dd5279df5165c386d77fed2e.zip |
stm32f1 boards_setup.cpp: Allow overriding the PLL multiplier.
Allow <board/board.h> 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 <mbolivar@leaflabs.com>
-rw-r--r-- | wirish/stm32f1/boards_setup.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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 <board/board.h> +// 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; |