summaryrefslogtreecommitdiff
path: root/nuttx/arch/sh/src/m16c/m16c_serial.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-18 12:00:36 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-02-18 12:00:36 +0000
commit9fa3ac76e655b92daf653fb833da59fd904e9d17 (patch)
treef484915ce11a90da3859bf15bd018347f11bb4ab /nuttx/arch/sh/src/m16c/m16c_serial.c
parentf3fad3954742d93d27c75c2f5a1b9542cf82fc32 (diff)
downloadpx4-nuttx-9fa3ac76e655b92daf653fb833da59fd904e9d17.tar.gz
px4-nuttx-9fa3ac76e655b92daf653fb833da59fd904e9d17.tar.bz2
px4-nuttx-9fa3ac76e655b92daf653fb833da59fd904e9d17.zip
Add support for boards with no serial ports
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1512 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sh/src/m16c/m16c_serial.c')
-rw-r--r--nuttx/arch/sh/src/m16c/m16c_serial.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/nuttx/arch/sh/src/m16c/m16c_serial.c b/nuttx/arch/sh/src/m16c/m16c_serial.c
index 12b614864..7ee4050f7 100644
--- a/nuttx/arch/sh/src/m16c/m16c_serial.c
+++ b/nuttx/arch/sh/src/m16c/m16c_serial.c
@@ -55,6 +55,12 @@
#include "os_internal.h"
#include "m16c_uart.h"
+/* Is there any serial support? This might be the case if the board does
+ * not have serial ports but supports a console through, say, an LCD.
+ */
+
+#if !defined(CONFIG_UART0_DISABLE) && !defined(CONFIG_UART1_DISABLE) && !defined(CONFIG_UART2_DISABLE)
+
/****************************************************************************
* Definitions
****************************************************************************/
@@ -1056,16 +1062,16 @@ static boolean up_txready(struct uart_dev_s *dev)
****************************************************************************/
/****************************************************************************
- * Name: up_serialinit
+ * Name: up_earlyconsoleinit
*
* Description:
* Performs the low level UART initialization early in
* debug so that the serial console will be available
- * during bootup. This must be called before up_serialinit.
+ * during bootup. This must be called before up_consoleinit.
*
****************************************************************************/
-void up_earlyserialinit(void)
+void up_earlyconsoleinit(void)
{
/* NOTE: All GPIO configuration for the UARTs was performed in
* up_lowsetup
@@ -1092,15 +1098,15 @@ void up_earlyserialinit(void)
}
/****************************************************************************
- * Name: up_serialinit
+ * Name: up_consoleinit
*
* Description:
* Register serial console and serial ports. This assumes
- * that up_earlyserialinit was called previously.
+ * that up_earlyconsoleinit was called previously.
*
****************************************************************************/
-void up_serialinit(void)
+void up_consoleinit(void)
{
/* Register the console */
@@ -1184,3 +1190,7 @@ int up_putc(int ch)
}
#endif /* CONFIG_USE_SERIALDRIVER */
+#elif defined(CONFIG_UART0_SERIAL_CONSOLE) || defined(CONFIG_UART1_SERIAL_CONSOLE)|| defined(CONFIG_UART2_SERIAL_CONSOLE)
+# error "A serial console selected, but corresponding UART not enabled"
+#endif /* !CONFIG_UART0_DISABLE && !CONFIG_UART1_DISABLE && !CONFIG_UART2_DISABLE */
+