Fix types in stm32 serial drivers
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2182 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
4453cf8152
commit
b9e8a3bfc5
@ -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
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user