summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-28 15:03:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-28 15:03:17 +0000
commite530202ed1c43f468e236add225e51080120ea56 (patch)
tree70ce245409ca55cda994ce812cf1d489681dc94f
parent5ec9ab67037ea37b4f21b2430340fc3dcf0a76bf (diff)
downloadnuttx-e530202ed1c43f468e236add225e51080120ea56.tar.gz
nuttx-e530202ed1c43f468e236add225e51080120ea56.tar.bz2
nuttx-e530202ed1c43f468e236add225e51080120ea56.zip
Serial driver needed even when no console; Fix user LED settings in all STM32 configurations
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5575 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--misc/tools/README.txt21
-rw-r--r--nuttx/ChangeLog7
-rw-r--r--nuttx/arch/arm/src/common/up_initialize.c14
-rw-r--r--nuttx/arch/arm/src/common/up_internal.h17
-rw-r--r--nuttx/arch/avr/src/at32uc3/at32uc3_config.h17
-rw-r--r--nuttx/arch/avr/src/at90usb/at90usb_config.h17
-rw-r--r--nuttx/arch/avr/src/atmega/atmega_config.h17
-rw-r--r--nuttx/arch/avr/src/common/up_initialize.c28
-rw-r--r--nuttx/arch/hc/src/common/up_initialize.c14
-rw-r--r--nuttx/arch/hc/src/common/up_internal.h17
-rw-r--r--nuttx/arch/mips/src/common/up_initialize.c12
-rw-r--r--nuttx/arch/mips/src/common/up_internal.h15
-rw-r--r--nuttx/arch/sh/src/common/up_initialize.c22
-rw-r--r--nuttx/arch/sh/src/common/up_internal.h15
-rw-r--r--nuttx/arch/x86/src/common/up_initialize.c14
-rw-r--r--nuttx/arch/x86/src/common/up_internal.h17
-rw-r--r--nuttx/arch/z16/src/common/up_initialize.c6
-rw-r--r--nuttx/arch/z16/src/common/up_internal.h35
-rw-r--r--nuttx/arch/z80/src/common/up_initialize.c14
-rw-r--r--nuttx/arch/z80/src/common/up_internal.h31
-rw-r--r--nuttx/configs/cloudctrl/src/up_userleds.c8
-rw-r--r--nuttx/configs/fire-stm32v2/src/up_userleds.c6
-rw-r--r--nuttx/configs/lpc4330-xplorer/src/up_userleds.c8
-rw-r--r--nuttx/configs/shenzhou/src/up_userleds.c8
-rw-r--r--nuttx/configs/stm3220g-eval/src/up_userleds.c8
-rw-r--r--nuttx/configs/stm3240g-eval/src/up_userleds.c8
-rw-r--r--nuttx/configs/stm32f4discovery/README.txt2
-rw-r--r--nuttx/configs/stm32f4discovery/src/up_userleds.c8
28 files changed, 314 insertions, 92 deletions
diff --git a/misc/tools/README.txt b/misc/tools/README.txt
index 1546c6f39..e1c67c5f0 100644
--- a/misc/tools/README.txt
+++ b/misc/tools/README.txt
@@ -30,25 +30,34 @@ kconfig-frontends
General build instructions:
cd kconfig-frontends
- ./configure
+ ./configure --enable-mconf
make
make install
- To suppress the nconf and the graphical interfaces which are not used by
- NuttX:
+ It is a good idea to add '--enable-mconf' on the 'configure' command line.
+ The kconfig-frontends make will generate many programs, but the NuttX
+ build system only needs the 'kconfig-conf' and 'kconfig-mconf' programs.
+ If the requirements for 'kconfig-mconf' are not supported by your system,
+ the kconfig-frontends configuration system will not build it. Adding the
+ option --enable-mconf assures you that 'kconfig-mconf' will be built or
+ if it is not built, it will tell you why it was not built.
- ./configure --disable-gconf --disable-qconf
+ To suppress the 'nconf' and the graphical front-ends which are not used by
+ NuttX, you can add:
+
+ ./configure --enable-mconfig --disable-nconf --disable-gconf --disable-qconf
make
make install
To suppress the graphical interfaces, use static libraries, and disable
creation of other utilities:
- ./configure --disable-shared --enable-static --disable-gconf --disable-qconf --disable-nconf --disable-utils
+ ./configure --disable-shared --enable-static --enable-mconfig --disable-nconf --disable-gconf --disable-qconf --disable-nconf --disable-utils
make
make install
- You may require root privileges to 'make install'.
+ The default installation location for the tools is /usr/local/bin. You
+ may require root privileges to 'make install'.
--program-prefix=
-----------------
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 4fc75c084..c2ce13738 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -4050,4 +4050,11 @@
configuration that uses USB CDC/ACM for the NSH console.
* configs/stm32f4discovery/nsh: Converted to use the kconfig-frontends
tools.
+ * configs/*/src/up_userleds.c: Fix a error that was cloned into
+ all STM32 user LED code. The wrong defintions were being used
+ to set LEDs on or off.
+ * arch/*/common/up_internal.h and arch/*/common/up_initialize.c:
+ Serial was driver was not being built if there is no console
+ device. Obviously, the serial driver may be needed even in
+ this case.
diff --git a/nuttx/arch/arm/src/common/up_initialize.c b/nuttx/arch/arm/src/common/up_initialize.c
index 80f9b1193..0ea3fcd35 100644
--- a/nuttx/arch/arm/src/common/up_initialize.c
+++ b/nuttx/arch/arm/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/src/common/up_initialize.c
*
- * Copyright (C) 2007-2010, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -161,11 +161,17 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
- /* Initialize the console device driver */
+ /* Initialize the serial device driver */
-#if defined(USE_SERIALDRIVER)
+#ifdef USE_SERIALDRIVER
up_serialinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#endif
+
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
+
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h
index 55071345f..8a24f003e 100644
--- a/nuttx/arch/arm/src/common/up_internal.h
+++ b/nuttx/arch/arm/src/common/up_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_internal.h
*
- * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,10 @@
#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS == 0
# undef USE_SERIALDRIVER
@@ -84,6 +87,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_config.h b/nuttx/arch/avr/src/at32uc3/at32uc3_config.h
index 1f942591a..8867fae86 100644
--- a/nuttx/arch/avr/src/at32uc3/at32uc3_config.h
+++ b/nuttx/arch/avr/src/at32uc3/at32uc3_config.h
@@ -1,7 +1,7 @@
/************************************************************************************
* arch/avr/src/at32uc3/at32uc3_config.h
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -144,7 +144,10 @@
# undef HAVE_SERIAL_CONSOLE
#endif
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
# undef USE_SERIALDRIVER
@@ -168,6 +171,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/avr/src/at90usb/at90usb_config.h b/nuttx/arch/avr/src/at90usb/at90usb_config.h
index 0aa73053e..3f0d80a19 100644
--- a/nuttx/arch/avr/src/at90usb/at90usb_config.h
+++ b/nuttx/arch/avr/src/at90usb/at90usb_config.h
@@ -1,7 +1,7 @@
/************************************************************************************
* arch/avr/src/at90usb/at90usb_config.h
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,10 @@
# undef HAVE_SERIAL_CONSOLE
#endif
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
# undef USE_SERIALDRIVER
@@ -87,6 +90,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/avr/src/atmega/atmega_config.h b/nuttx/arch/avr/src/atmega/atmega_config.h
index 3835fb459..5d784ccf3 100644
--- a/nuttx/arch/avr/src/atmega/atmega_config.h
+++ b/nuttx/arch/avr/src/atmega/atmega_config.h
@@ -1,7 +1,7 @@
/************************************************************************************
* arch/avr/src/atmega/atmega_config.h
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -68,7 +68,10 @@
# undef HAVE_SERIAL_CONSOLE
#endif
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
# undef USE_SERIALDRIVER
@@ -92,6 +95,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/avr/src/common/up_initialize.c b/nuttx/arch/avr/src/common/up_initialize.c
index 76de41c99..684dab09d 100644
--- a/nuttx/arch/avr/src/common/up_initialize.c
+++ b/nuttx/arch/avr/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/avr/src/common/up_initialize.c
*
- * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -57,6 +57,10 @@
* up_serialinit to be incorrectly called if there is no USART configured to
* be an RS-232 device (see as an example arch/avr/src/at32uc23/at32uc3_config.h)
* This will probably have to be revisited someday.
+ *
+ * If a console is enabled and no other console device is specified, then a
+ * serial console is
+ * assumed.
*/
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
@@ -78,6 +82,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
@@ -182,11 +196,17 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
- /* Initialize the console device driver */
+ /* Initialize the serial device driver */
-#if defined(USE_SERIALDRIVER)
+#ifdef USE_SERIALDRIVER
up_serialinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#endif
+
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
+
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/hc/src/common/up_initialize.c b/nuttx/arch/hc/src/common/up_initialize.c
index b9dfd9ba1..885e79905 100644
--- a/nuttx/arch/hc/src/common/up_initialize.c
+++ b/nuttx/arch/hc/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/hc/src/common/up_initialize.c
*
- * Copyright (C) 2009-2010, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009-2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -149,11 +149,17 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
- /* Initialize the console device driver */
+ /* Initialize the serial device driver */
-#if defined(USE_SERIALDRIVER)
+#ifdef USE_SERIALDRIVER
up_serialinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#endif
+
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
+
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/hc/src/common/up_internal.h b/nuttx/arch/hc/src/common/up_internal.h
index f1daf690f..0de737fb6 100644
--- a/nuttx/arch/hc/src/common/up_internal.h
+++ b/nuttx/arch/hc/src/common/up_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/hc/src/common/up_internal.h
*
- * Copyright (C) 2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -62,7 +62,10 @@
#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
# undef USE_SERIALDRIVER
@@ -83,6 +86,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/mips/src/common/up_initialize.c b/nuttx/arch/mips/src/common/up_initialize.c
index 3063b4b4b..a0f0ca9d5 100644
--- a/nuttx/arch/mips/src/common/up_initialize.c
+++ b/nuttx/arch/mips/src/common/up_initialize.c
@@ -151,11 +151,17 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
- /* Initialize the console device driver */
+ /* Initialize the serial device driver */
-#if defined(USE_SERIALDRIVER)
+#ifdef USE_SERIALDRIVER
up_serialinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#endif
+
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
+
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/mips/src/common/up_internal.h b/nuttx/arch/mips/src/common/up_internal.h
index b284961b0..927538dea 100644
--- a/nuttx/arch/mips/src/common/up_internal.h
+++ b/nuttx/arch/mips/src/common/up_internal.h
@@ -60,7 +60,10 @@
#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
# undef USE_SERIALDRIVER
@@ -81,6 +84,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/sh/src/common/up_initialize.c b/nuttx/arch/sh/src/common/up_initialize.c
index 3aef5c637..727dc1352 100644
--- a/nuttx/arch/sh/src/common/up_initialize.c
+++ b/nuttx/arch/sh/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_initialize.c
*
- * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2010, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -136,16 +136,20 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
- /* Initialize the console device driver. NOTE that the naming
- * implies that the console is a serial driver. That is usually the case,
- * however, if no UARTs are enabled, the console could als be provided
- * through some other device, such as an LCD. Architecture-specific logic
- * will have to detect that case.
+ /* Initialize the serial device driver */
+
+#ifdef USE_SERIALDRIVER
+ up_serialinit();
+#endif
+
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver). NOTE that the naming implies that the console is a serial
+ * driver. That is usually the case, however, if no UARTs are enabled, the
+ * console could als be provided through some other device, such as an LCD.
+ * Architecture-specific logic will have to detect that case.
*/
-#if defined(USE_SERIALDRIVER)
- up_consoleinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/sh/src/common/up_internal.h b/nuttx/arch/sh/src/common/up_internal.h
index f47b1078f..f56e97c97 100644
--- a/nuttx/arch/sh/src/common/up_internal.h
+++ b/nuttx/arch/sh/src/common/up_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/sh/src/common/up_internal.h
*
- * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -67,6 +67,9 @@
* however, if no UARTs are enabled, the console could als be provided
* through some other device, such as an LCD. Architecture-specific logic
* will have to detect that case.
+ *
+ * If a console is enabled and no other console device is specified, then
+ * a serial console is assumed.
*/
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
@@ -88,6 +91,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/x86/src/common/up_initialize.c b/nuttx/arch/x86/src/common/up_initialize.c
index 49238556d..b49dd55b4 100644
--- a/nuttx/arch/x86/src/common/up_initialize.c
+++ b/nuttx/arch/x86/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/x86/src/common/up_initialize.c
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -151,11 +151,17 @@ void up_initialize(void)
devnull_register(); /* Standard /dev/null */
#endif
- /* Initialize the console device driver */
+ /* Initialize the serial device driver */
-#if defined(USE_SERIALDRIVER)
+#ifdef USE_SERIALDRIVER
up_serialinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#endif
+
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
+
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/x86/src/common/up_internal.h b/nuttx/arch/x86/src/common/up_internal.h
index df43ca1a8..c27717c38 100644
--- a/nuttx/arch/x86/src/common/up_internal.h
+++ b/nuttx/arch/x86/src/common/up_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/x86/src/common/up_internal.h
*
- * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -62,7 +62,10 @@
#undef CONFIG_SUPPRESS_UART_CONFIG /* DEFINED: Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* DEFINED: Dump task state on exit */
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
# undef USE_SERIALDRIVER
@@ -83,6 +86,16 @@
# endif
#endif
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
+# define USE_SERIALDRIVER 1
+#endif
+
/* Determine which device to use as the system logging device */
#ifndef CONFIG_SYSLOG
diff --git a/nuttx/arch/z16/src/common/up_initialize.c b/nuttx/arch/z16/src/common/up_initialize.c
index e9c58c489..f06d8ff24 100644
--- a/nuttx/arch/z16/src/common/up_initialize.c
+++ b/nuttx/arch/z16/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_initialize.c
*
- * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -168,7 +168,9 @@ void up_initialize(void)
up_serialinit();
#endif
- /* Initialize the console device driver */
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
diff --git a/nuttx/arch/z16/src/common/up_internal.h b/nuttx/arch/z16/src/common/up_internal.h
index 2c1968e8d..e4dfd1dd5 100644
--- a/nuttx/arch/z16/src/common/up_internal.h
+++ b/nuttx/arch/z16/src/common/up_internal.h
@@ -1,7 +1,7 @@
/****************************************************************************
* common/up_internal.h
*
- * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -60,15 +60,42 @@
#undef CONFIG_Z16_LOWPUTC /* Support up_lowputc for debug */
#undef CONFIG_Z16_LOWGETC /* support up_lowgetc for debug */
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC) || \
CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE)
# define USE_LOWCONSOLE 1
# define USE_LOWUARTINIT 1
-#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
+#elif !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
+# undef USE_SERIALDRIVER
+# undef USE_EARLYSERIALINIT
+# undef CONFIG_DEV_LOWCONSOLE
+# undef CONFIG_RAMLOG_CONSOLE
+#else
+# if defined(CONFIG_RAMLOG_CONSOLE)
+# undef USE_SERIALDRIVER
+# undef USE_EARLYSERIALINIT
+# undef CONFIG_DEV_LOWCONSOLE
+# elif defined(CONFIG_DEV_LOWCONSOLE)
+# undef USE_SERIALDRIVER
+# undef USE_EARLYSERIALINIT
+# else
+# define USE_SERIALDRIVER 1
+# define USE_EARLYSERIALINIT 1
+# endif
+#endif
+
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
# define USE_SERIALDRIVER 1
-# define USE_EARLYSERIALINIT 1
#endif
/* Determine which device to use as the system logging device */
diff --git a/nuttx/arch/z80/src/common/up_initialize.c b/nuttx/arch/z80/src/common/up_initialize.c
index 652a7cc88..c7b7bdb22 100644
--- a/nuttx/arch/z80/src/common/up_initialize.c
+++ b/nuttx/arch/z80/src/common/up_initialize.c
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/z80/src/common/up_initialize.c
*
- * Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2009, 2012-2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -161,15 +161,15 @@ void up_initialize(void)
/* Initialize the serial device driver */
-#ifdef USE_LOWSERIALINIT
- up_lowserialinit();
+#ifdef USE_SERIALDRIVER
+ up_serialinit();
#endif
- /* Initialize the console device driver */
+ /* Initialize the console device driver (if it is other than the standard
+ * serial driver).
+ */
-#if defined(USE_SERIALDRIVER)
- up_serialinit();
-#elif defined(CONFIG_DEV_LOWCONSOLE)
+#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
diff --git a/nuttx/arch/z80/src/common/up_internal.h b/nuttx/arch/z80/src/common/up_internal.h
index 5f1750b64..36e1ac141 100644
--- a/nuttx/arch/z80/src/common/up_internal.h
+++ b/nuttx/arch/z80/src/common/up_internal.h
@@ -66,7 +66,10 @@
* Definitions
****************************************************************************/
-/* Determine which (if any) console driver to use */
+/* Determine which (if any) console driver to use. If a console is enabled
+ * and no other console device is specified, then a serial console is
+ * assumed.
+ */
#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE)
# undef USE_SERIALDRIVER
@@ -75,9 +78,31 @@
# else
# undef USE_LOWSERIALINIT
# endif
-#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
+#elif !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS <= 0
+# undef USE_SERIALDRIVER
+# undef USE_LOWSERIALINIT
+# undef CONFIG_DEV_LOWCONSOLE
+# undef CONFIG_RAMLOG_CONSOLE
+#else
+# undef USE_LOWSERIALINIT
+# if defined(CONFIG_RAMLOG_CONSOLE)
+# undef USE_SERIALDRIVER
+# undef CONFIG_DEV_LOWCONSOLE
+# elif defined(CONFIG_DEV_LOWCONSOLE)
+# undef USE_SERIALDRIVER
+# else
+# define USE_SERIALDRIVER 1
+# endif
+#endif
+
+/* If some other device is used as the console, then the serial driver may
+ * still be needed. Let's assume that if the upper half serial driver is
+ * built, then the lower half will also be needed. There is no need for
+ * the early serial initialization in this case.
+ */
+
+#if !defined(USE_SERIALDRIVER) && defined(CONFIG_STANDARD_SERIAL)
# define USE_SERIALDRIVER 1
-# undef USE_LOWSERIALINIT
#endif
/****************************************************************************
diff --git a/nuttx/configs/cloudctrl/src/up_userleds.c b/nuttx/configs/cloudctrl/src/up_userleds.c
index 5c112123b..bbb7cc62c 100644
--- a/nuttx/configs/cloudctrl/src/up_userleds.c
+++ b/nuttx/configs/cloudctrl/src/up_userleds.c
@@ -123,10 +123,10 @@ void stm32_setled(int led, bool ledon)
void stm32_setleds(uint8_t ledset)
{
- stm32_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- stm32_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
- stm32_gpiowrite(BOARD_LED3, (ledset & BOARD_LED3_BIT) == 0);
- stm32_gpiowrite(BOARD_LED4, (ledset & BOARD_LED4_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/fire-stm32v2/src/up_userleds.c b/nuttx/configs/fire-stm32v2/src/up_userleds.c
index da43d03ad..3dd1843ee 100644
--- a/nuttx/configs/fire-stm32v2/src/up_userleds.c
+++ b/nuttx/configs/fire-stm32v2/src/up_userleds.c
@@ -131,9 +131,9 @@ void stm32_setled(int led, bool ledon)
void stm32_setleds(uint8_t ledset)
{
- stm32_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- stm32_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
- stm32_gpiowrite(BOARD_LED3, (ledset & BOARD_LED3_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/lpc4330-xplorer/src/up_userleds.c b/nuttx/configs/lpc4330-xplorer/src/up_userleds.c
index e7b4b1189..2d8b5b511 100644
--- a/nuttx/configs/lpc4330-xplorer/src/up_userleds.c
+++ b/nuttx/configs/lpc4330-xplorer/src/up_userleds.c
@@ -140,8 +140,8 @@ void lpc43_ledinit(void)
void lpc43_setled(int led, bool ledon)
{
- uint16_t gpiocfg = (led == BOARD_LED1 ? BOARD_LED1 : BOARD_LED2);
- lpc43_gpio_write(GPIO_LED1, !ledon);
+ uint16_t gpiocfg = (led == BOARD_LED1 ? GPIO_LED1 : GPIO_LED2);
+ lpc43_gpio_write(gpiocfg, !ledon);
}
/****************************************************************************
@@ -150,8 +150,8 @@ void lpc43_setled(int led, bool ledon)
void lpc43_setleds(uint8_t ledset)
{
- lpc43_gpio_write(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- lpc43_gpio_write(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ lpc43_gpio_write(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ lpc43_gpio_write(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/shenzhou/src/up_userleds.c b/nuttx/configs/shenzhou/src/up_userleds.c
index 0ba029228..4e1493a8d 100644
--- a/nuttx/configs/shenzhou/src/up_userleds.c
+++ b/nuttx/configs/shenzhou/src/up_userleds.c
@@ -122,10 +122,10 @@ void stm32_setled(int led, bool ledon)
void stm32_setleds(uint8_t ledset)
{
- stm32_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- stm32_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
- stm32_gpiowrite(BOARD_LED3, (ledset & BOARD_LED3_BIT) == 0);
- stm32_gpiowrite(BOARD_LED4, (ledset & BOARD_LED4_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/stm3220g-eval/src/up_userleds.c b/nuttx/configs/stm3220g-eval/src/up_userleds.c
index 6dc3db135..84510c703 100644
--- a/nuttx/configs/stm3220g-eval/src/up_userleds.c
+++ b/nuttx/configs/stm3220g-eval/src/up_userleds.c
@@ -122,10 +122,10 @@ void stm32_setled(int led, bool ledon)
void stm32_setleds(uint8_t ledset)
{
- stm32_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- stm32_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
- stm32_gpiowrite(BOARD_LED3, (ledset & BOARD_LED3_BIT) == 0);
- stm32_gpiowrite(BOARD_LED4, (ledset & BOARD_LED4_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/stm3240g-eval/src/up_userleds.c b/nuttx/configs/stm3240g-eval/src/up_userleds.c
index 59be38561..01c4b36d6 100644
--- a/nuttx/configs/stm3240g-eval/src/up_userleds.c
+++ b/nuttx/configs/stm3240g-eval/src/up_userleds.c
@@ -122,10 +122,10 @@ void stm32_setled(int led, bool ledon)
void stm32_setleds(uint8_t ledset)
{
- stm32_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- stm32_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
- stm32_gpiowrite(BOARD_LED3, (ledset & BOARD_LED3_BIT) == 0);
- stm32_gpiowrite(BOARD_LED4, (ledset & BOARD_LED4_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */
diff --git a/nuttx/configs/stm32f4discovery/README.txt b/nuttx/configs/stm32f4discovery/README.txt
index e34168224..e9c0e81c2 100644
--- a/nuttx/configs/stm32f4discovery/README.txt
+++ b/nuttx/configs/stm32f4discovery/README.txt
@@ -269,7 +269,7 @@ LEDs
====
The STM32F4Discovery board has four LEDs; green, organge, red and blue on the
-board.. These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
+board. These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
defined. In that case, the usage by the board port is defined in
include/board.h and src/up_leds.c. The LEDs are used to encode OS-related
events as follows:
diff --git a/nuttx/configs/stm32f4discovery/src/up_userleds.c b/nuttx/configs/stm32f4discovery/src/up_userleds.c
index 90adb4882..173c12696 100644
--- a/nuttx/configs/stm32f4discovery/src/up_userleds.c
+++ b/nuttx/configs/stm32f4discovery/src/up_userleds.c
@@ -222,10 +222,10 @@ void stm32_setled(int led, bool ledon)
void stm32_setleds(uint8_t ledset)
{
- stm32_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
- stm32_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
- stm32_gpiowrite(BOARD_LED3, (ledset & BOARD_LED3_BIT) == 0);
- stm32_gpiowrite(BOARD_LED4, (ledset & BOARD_LED4_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED1, (ledset & BOARD_LED1_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED2, (ledset & BOARD_LED2_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED3, (ledset & BOARD_LED3_BIT) == 0);
+ stm32_gpiowrite(GPIO_LED4, (ledset & BOARD_LED4_BIT) == 0);
}
/****************************************************************************