From adbbbc19369f64d64f72d9417a0bf0272d1ba497 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 5 Jun 2012 17:50:18 -0400 Subject: STM32F2: Allow boards to override PLL configuration. Signed-off-by: Marti Bolivar --- wirish/stm32f2/boards_setup.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'wirish') diff --git a/wirish/stm32f2/boards_setup.cpp b/wirish/stm32f2/boards_setup.cpp index 876a65b..dd872d3 100644 --- a/wirish/stm32f2/boards_setup.cpp +++ b/wirish/stm32f2/boards_setup.cpp @@ -40,13 +40,27 @@ #include #include #include +#include -// PLL configuration for 25 MHz external oscillator --> 120 MHz SYSCLK. -#define PLL_Q 5 -#define PLL_P 2 -#define PLL_N 240 -#define PLL_M 25 -static stm32f2_rcc_pll_data pll_data = {PLL_Q, PLL_P, PLL_N, PLL_M}; +// PLL config for 25 MHz external crystal --> 120 MHz SYSCLK, with +// 48 MHz PLL48CK. +#ifndef BOARD_PLL_Q +#define BOARD_PLL_Q 5 +#endif +#ifndef BOARD_PLL_P +#define BOARD_PLL_P 2 +#endif +#ifndef BOARD_PLL_N +#define BOARD_PLL_N 240 +#endif +#ifndef BOARD_PLL_M +#define BOARD_PLL_M 25 +#endif + +static stm32f2_rcc_pll_data pll_data = {BOARD_PLL_Q, + BOARD_PLL_P, + BOARD_PLL_N, + BOARD_PLL_M}; namespace wirish { namespace priv { -- cgit v1.2.3