From 1b818a3679bc0b7249fca64b2f3c115afe1b5b77 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Mon, 29 Apr 2013 18:14:36 +0200 Subject: [PATCH] [stm32] usart6 for F2/F4 --- lib/stm32/common/usart_common_all.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/stm32/common/usart_common_all.c b/lib/stm32/common/usart_common_all.c index b550ba4d..452fa12e 100644 --- a/lib/stm32/common/usart_common_all.c +++ b/lib/stm32/common/usart_common_all.c @@ -51,19 +51,16 @@ void usart_set_baudrate(u32 usart, u32 baud) { u32 clock = rcc_ppre1_frequency; -//#ifdef STM32F1 - if (usart == USART1) { - clock = rcc_ppre2_frequency; - } -/* This has to be added for F2 when it get's support for USART6 */ -/* -#else +#if defined STM32F2 || defined STM32F4 if ((usart == USART1) || (usart == USART6)) { clock = rcc_ppre2_frequency; } +#else + if (usart == USART1) { + clock = rcc_ppre2_frequency; + } #endif -*/ /* * Yes it is as simple as that. The reference manual is