summaryrefslogtreecommitdiff
path: root/nuttx/arch/avr/src
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 /nuttx/arch/avr/src
parent5ec9ab67037ea37b4f21b2430340fc3dcf0a76bf (diff)
downloadpx4-nuttx-e530202ed1c43f468e236add225e51080120ea56.tar.gz
px4-nuttx-e530202ed1c43f468e236add225e51080120ea56.tar.bz2
px4-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
Diffstat (limited to 'nuttx/arch/avr/src')
-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
4 files changed, 69 insertions, 10 deletions
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();