From 283f0c3b294f60b32ee011b3bd7612f56bc26655 Mon Sep 17 00:00:00 2001 From: Vincent Dupont Date: Wed, 14 Dec 2016 10:21:15 +0100 Subject: [PATCH] stm32f2: improve MCO2 clock output support MCO2 output prescaler can be set by using: Valid values are in range 1 - 5 --- cpu/stm32f2/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/stm32f2/cpu.c b/cpu/stm32f2/cpu.c index 3d8f7ef123..8304176755 100644 --- a/cpu/stm32f2/cpu.c +++ b/cpu/stm32f2/cpu.c @@ -103,7 +103,7 @@ static void clk_init(void) RCC->CFGR |= (uint32_t) RCC_CFGR_MCO2_0; RCC->CFGR &= ~(uint32_t) RCC_CFGR_MCO2_1; /* MCO2 prescaler div by 5 */ - RCC->CFGR |= (uint32_t) RCC_CFGR_MCO2PRE_0 | RCC_CFGR_MCO2PRE_1 | RCC_CFGR_MCO2PRE_2 ; + RCC->CFGR |= (uint32_t) ((CLOCK_MC02_PRE + 4 - 2) & 0x7) << 27; /* enable PLL I2S clock */ RCC->CR |= RCC_CR_PLLI2SON; /* wait till PLL I2S clock is ready */