summaryrefslogtreecommitdiff
path: root/nuttx/arch/mips/src/pic32mx/pic32mx-serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/mips/src/pic32mx/pic32mx-serial.c')
-rw-r--r--nuttx/arch/mips/src/pic32mx/pic32mx-serial.c40
1 files changed, 33 insertions, 7 deletions
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 */
/****************************************************************************