From 8bdbc20e74907f57cc1d1659bb256eb51ed55aaf Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 18 Apr 2015 15:30:04 +0100 Subject: stmhal: Make HSE PLL parameters configurable per board. --- stmhal/system_stm32f4xx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'stmhal/system_stm32f4xx.c') diff --git a/stmhal/system_stm32f4xx.c b/stmhal/system_stm32f4xx.c index dabc3a9ad..207fb528b 100644 --- a/stmhal/system_stm32f4xx.c +++ b/stmhal/system_stm32f4xx.c @@ -91,6 +91,7 @@ * @{ */ +#include "mpconfigboard.h" #include "stm32f4xx_hal.h" void __fatal_error(const char *msg); @@ -365,10 +366,10 @@ void SystemClock_Config(void) RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - RCC_OscInitStruct.PLL.PLLM = HSE_VALUE/1000000; - RCC_OscInitStruct.PLL.PLLN = 336; - RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; - RCC_OscInitStruct.PLL.PLLQ = 7; + RCC_OscInitStruct.PLL.PLLM = MICROPY_HW_CLK_PLLM; + RCC_OscInitStruct.PLL.PLLN = MICROPY_HW_CLK_PLLN; + RCC_OscInitStruct.PLL.PLLP = MICROPY_HW_CLK_PLLP; + RCC_OscInitStruct.PLL.PLLQ = MICROPY_HW_CLK_PLLQ; if(HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { __fatal_error("HAL_RCC_OscConfig"); -- cgit v1.2.3