From 9be0c168895dae40d5818514813d4ba39b14186f Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 13 Mar 2012 19:21:04 +0000 Subject: Add a PIC32 configuration that supports only a Telnet console git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4486 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/mips/src/pic32mx/pic32mx-serial.c | 40 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) (limited to 'nuttx/arch/mips/src/pic32mx') diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c b/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c index 334c03d1c..f04e7f682 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c @@ -66,13 +66,6 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Some sanity checks *******************************************************/ -/* Is there at least one UART enabled and configured as a RS-232 device? */ - -#ifndef HAVE_UART_DEVICE -# warning "No UARTs enabled" -#endif - /* If we are not using the serial driver for the console, then we still must * provide some minimal implementation of up_putc. */ @@ -119,6 +112,14 @@ # endif #endif +/* Common initialization logic will not not know that the all of the UARTs + * have been disabled. So, as a result, we may still have to provide + * stub implementations of up_earlyserialinit(), up_serialinit(), and + * up_putc(). + */ + +#ifdef HAVE_UART_DEVICE + /* These values describe the set of enabled interrupts */ #define IE_RX (1 << 0) @@ -868,6 +869,31 @@ int up_putc(int ch) return ch; } +/**************************************************************************** + * Name: up_earlyserialinit, up_serialinit, and up_putc + * + * Description: + * stubs that may be needed. These stubs would be used if all UARTs are + * disabled. In that case, the logic in common/up_initialize() is not + * smart enough to know that there are not UARTs and will still expect + * these interfaces to be provided. + * + ****************************************************************************/ +#else /* HAVE_UART_DEVICE */ +void up_earlyserialinit(void) +{ +} + +void up_serialinit(void) +{ +} + +int up_putc(int ch) +{ + return ch; +} + +#endif /* HAVE_UART_DEVICE */ #else /* USE_SERIALDRIVER */ /**************************************************************************** -- cgit v1.2.3