summaryrefslogtreecommitdiff
path: root/nuttx/arch/z16/src/common
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-30 00:59:17 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-30 00:59:17 +0000
commit2f9ef93c914795ff502f8371084cf3be931494a7 (patch)
treeededbcdf9e6b6c6baf72e0acbfede21062cbf9db /nuttx/arch/z16/src/common
parentb15595dcc890f5f9440cf6150e707a5f1739d396 (diff)
downloadpx4-nuttx-2f9ef93c914795ff502f8371084cf3be931494a7.tar.gz
px4-nuttx-2f9ef93c914795ff502f8371084cf3be931494a7.tar.bz2
px4-nuttx-2f9ef93c914795ff502f8371084cf3be931494a7.zip
Added low-level console driver
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@585 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z16/src/common')
-rw-r--r--nuttx/arch/z16/src/common/up_initialize.c6
-rw-r--r--nuttx/arch/z16/src/common/up_internal.h20
2 files changed, 22 insertions, 4 deletions
diff --git a/nuttx/arch/z16/src/common/up_initialize.c b/nuttx/arch/z16/src/common/up_initialize.c
index 8a30d33ad..b7fc643d2 100644
--- a/nuttx/arch/z16/src/common/up_initialize.c
+++ b/nuttx/arch/z16/src/common/up_initialize.c
@@ -160,7 +160,13 @@ void up_initialize(void)
/* Initialize the serial device driver */
+#ifdef CONFIG_USE_SERIALDRIVER
up_serialinit();
+#endif
+
+#ifdef CONFIG_USE_LOWCONSOLE
+ lowconsole_init();
+#endif
/* Initialize the netwok */
diff --git a/nuttx/arch/z16/src/common/up_internal.h b/nuttx/arch/z16/src/common/up_internal.h
index f6acb97a6..144fee754 100644
--- a/nuttx/arch/z16/src/common/up_internal.h
+++ b/nuttx/arch/z16/src/common/up_internal.h
@@ -58,6 +58,17 @@
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* Dump task state on exit */
+/* Determine which (if any) console driver to use */
+
+#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC) || \
+ CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE)
+# define CONFIG_USE_LOWCONSOLE 1
+# define CONFIG_USE_LOWUARTINIT 1
+#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
+# define CONFIG_USE_SERIALDRIVER 1
+# define CONFIG_USE_EARLYSERIALINIT 1
+#endif
+
/* Macros for portability */
#define IN_INTERRUPT (current_regs != NULL)
@@ -118,12 +129,13 @@ void up_addregion(void);
/* Defined in up_serial.c */
-#if CONFIG_NFILE_DESCRIPTORS > 0
+#ifdef CONFIG_USE_SERIALDRIVER
extern void up_earlyserialinit(void);
extern void up_serialinit(void);
-#else
-# define up_earlyserialinit()
-# define up_serialinit()
+#endif
+
+#ifdef CONFIG_USE_LOWCONSOLE
+extern void lowconsole_init(void);
#endif
/* Defined in up_timerisr.c */