summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-28 17:43:55 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-28 17:43:55 +0000
commit00aaf1187f47fd3e9a2801b6468d1f382819981c (patch)
tree76d575d4d2acd9b74dcfbabb60727d85444fb733 /nuttx/arch/arm
parente530202ed1c43f468e236add225e51080120ea56 (diff)
downloadpx4-nuttx-00aaf1187f47fd3e9a2801b6468d1f382819981c.tar.gz
px4-nuttx-00aaf1187f47fd3e9a2801b6468d1f382819981c.tar.bz2
px4-nuttx-00aaf1187f47fd3e9a2801b6468d1f382819981c.zip
Misc SYSLOG and STM32 serial fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5576 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm')
-rw-r--r--nuttx/arch/arm/src/stm32/stm32_serial.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_serial.c b/nuttx/arch/arm/src/stm32/stm32_serial.c
index 0151bd247..12da1ee10 100644
--- a/nuttx/arch/arm/src/stm32/stm32_serial.c
+++ b/nuttx/arch/arm/src/stm32/stm32_serial.c
@@ -1998,7 +1998,8 @@ void up_serialinit(void)
{
#ifdef HAVE_UART
char devname[16];
- unsigned i, j;
+ unsigned i;
+ unsigned minor = 0;
#ifdef CONFIG_PM
int ret;
#endif
@@ -2015,6 +2016,7 @@ void up_serialinit(void)
#if CONSOLE_UART > 0
(void)uart_register("/dev/console", &uart_devs[CONSOLE_UART - 1]->dev);
(void)uart_register("/dev/ttyS0", &uart_devs[CONSOLE_UART - 1]->dev);
+ minor = 1;
/* If we need to re-initialise the console to enable DMA do that here. */
@@ -2028,19 +2030,19 @@ void up_serialinit(void)
strcpy(devname, "/dev/ttySx");
- for (i = 0, j = 1; i < STM32_NUSART; i++)
+ for (i = 0; i < STM32_NUSART; i++)
{
- /* don't create a device for the console - we did that above */
+ /* Don't create a device for the console - we did that above */
if ((uart_devs[i] == 0) || (uart_devs[i]->dev.isconsole))
{
continue;
}
- /* register USARTs as devices in increasing order */
+ /* Register USARTs as devices in increasing order */
- devname[9] = '0' + j++;
+ devname[9] = '0' + minor++;
(void)uart_register(devname, &uart_devs[i]->dev);
}
#endif /* HAVE UART */