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:
patacongo
2009-10-29 02:18:09 +00:00
parent 695206713a
commit 709e5a63ea
3 changed files with 16 additions and 12 deletions

View File

@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX RTOS</i></font></big></h1>
<p>Last Updated: October 24, 2009</p>
<p>Last Updated: October 28, 2009</p>
</td>
</tr>
</table>
@@ -1577,6 +1577,10 @@ nuttx-0.4.13 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;
context switches and background/user context switches. This change should
improve the performance of those background/user context switches by a factor
of about two.
* arch/arm/src/stm32/ - fix several typos in the serial logic. It turns out
that these typose don't make any difference as long as you use only one
serial port and all uarts are configured the same. But the typos are bugs
waiting to happen in any other configuration.
pascal-0.1.3 2009-xx-xx Gregory Nutt &lt;spudmonkey@racsa.co.cr&gt;

View File

@@ -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

View File

@@ -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 */