From b9e8a3bfc57b1945da40c25a1369153a403d1195 Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 29 Oct 2009 02:18:09 +0000 Subject: [PATCH] Fix types in stm32 serial drivers git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2182 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/src/stm32/stm32_lowputc.c | 18 +++++++++--------- arch/arm/src/stm32/stm32_serial.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/arm/src/stm32/stm32_lowputc.c b/arch/arm/src/stm32/stm32_lowputc.c index 05e9d412e2..e2ead3772c 100644 --- a/arch/arm/src/stm32/stm32_lowputc.c +++ b/arch/arm/src/stm32/stm32_lowputc.c @@ -95,27 +95,27 @@ # define STM32_CONSOLE_PARITY CONFIG_USART2_PARITY # define STM32_CONSOLE_2STOP CONFIG_USART2_2STOP #elif defined(CONFIG_USART3_SERIAL_CONSOLE) -# define STM32_CONSOLE_BASE STM32_USART2_BASE +# define STM32_CONSOLE_BASE STM32_USART3_BASE # define STM32_APBCLOCK STM32_PCLK1_FREQUENCY -# define STM32_CONSOLE_BAUD CONFIG_USART2_BAUD -# define STM32_CONSOLE_BITS CONFIG_USART2_BITS -# define STM32_CONSOLE_PARITY CONFIG_USART2_PARITY -# define STM32_CONSOLE_2STOP CONFIG_USART2_2STOP +# define STM32_CONSOLE_BAUD CONFIG_USART3_BAUD +# define STM32_CONSOLE_BITS CONFIG_USART3_BITS +# define STM32_CONSOLE_PARITY CONFIG_USART3_PARITY +# define STM32_CONSOLE_2STOP CONFIG_USART3_2STOP #else # error "No CONFIG_USARTn_SERIAL_CONSOLE Setting" #endif /* CR1 settings */ -#if CONFIG_USART2_BITS == 9 +#if STM32_CONSOLE_BITS == 9 # define USART_CR1_M_VALUE USART_CR1_M #else # define USART_CR1_M_VALUE 0 #endif -#if CONFIG_USART2_PARITY == 1 +#if STM32_CONSOLE_PARITY == 1 # define USART_CR1_PARITY_VALUE (USART_CR1_PCE|USART_CR1_PS) -#elif CONFIG_USART2_PARITY == 2 +#elif STM32_CONSOLE_PARITY == 2 # define USART_CR1_PARITY_VALUE USART_CR1_PCE #else # define USART_CR1_PARITY_VALUE 0 @@ -126,7 +126,7 @@ /* CR2 settings */ -#if CONFIG_USART2_2STOP != 0 +#if STM32_CONSOLE_2STOP != 0 # define USART_CR2_STOP2_VALUE USART_CR2_STOP2 #else # define USART_CR2_STOP2_VALUE 0 diff --git a/arch/arm/src/stm32/stm32_serial.c b/arch/arm/src/stm32/stm32_serial.c index 5d946c7c81..a702b1b5c5 100644 --- a/arch/arm/src/stm32/stm32_serial.c +++ b/arch/arm/src/stm32/stm32_serial.c @@ -81,7 +81,7 @@ # define HAVE_CONSOLE 1 #elif defined(CONFIG_USART3_SERIAL_CONSOLE) && defined(CONFIG_STM32_USART3) # undef CONFIG_USART1_SERIAL_CONSOLE -# undef CONFIG_USART3_SERIAL_CONSOLE +# undef CONFIG_USART2_SERIAL_CONSOLE # define HAVE_CONSOLE 1 #else # warning "No valid CONFIG_USARTn_SERIAL_CONSOLE Setting" @@ -508,7 +508,7 @@ static int up_setup(struct uart_dev_s *dev) fraction = (usartdiv32 - (mantissa << 5) + 1) >> 1; brr |= fraction << USART_BRR_FRAC_SHIFT; - up_serialout(priv, STM32_USART1_BRR, brr); + up_serialout(priv, STM32_USART_BRR_OFFSET, brr); /* Enable Rx, Tx, and the USART */