summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-10-08 02:21:43 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-10-08 02:21:43 +0000
commite3d2e0f83225600b1cec0972a683e8e52877378f (patch)
tree84cef50a4e1004afde34f77282319d11d828e320
parent03ab71774443c9c45135f0834d571a6cd2399bfa (diff)
downloadpx4-nuttx-e3d2e0f83225600b1cec0972a683e8e52877378f.tar.gz
px4-nuttx-e3d2e0f83225600b1cec0972a683e8e52877378f.tar.bz2
px4-nuttx-e3d2e0f83225600b1cec0972a683e8e52877378f.zip
Add beginnings of a serial console
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2977 42af7a65-404d-4744-a932-0658087f49c3
-rwxr-xr-xnuttx/arch/avr/src/at91uc3/Make.defs2
-rwxr-xr-xnuttx/arch/avr/src/at91uc3/at91uc3_internal.h18
-rw-r--r--nuttx/arch/avr/src/at91uc3/at91uc3_lowconsole.c105
-rw-r--r--nuttx/arch/avr/src/at91uc3/at91uc3_lowinit.c12
-rw-r--r--nuttx/arch/avr/src/at91uc3/at91uc3_serial.c18
-rwxr-xr-xnuttx/configs/avr32dev1/src/avr32dev1_internal.h4
-rwxr-xr-xnuttx/configs/avr32dev1/src/up_boot.c6
-rwxr-xr-xnuttx/configs/avr32dev1/src/up_leds.c4
8 files changed, 136 insertions, 33 deletions
diff --git a/nuttx/arch/avr/src/at91uc3/Make.defs b/nuttx/arch/avr/src/at91uc3/Make.defs
index fc460ad28..88083f6fe 100755
--- a/nuttx/arch/avr/src/at91uc3/Make.defs
+++ b/nuttx/arch/avr/src/at91uc3/Make.defs
@@ -50,7 +50,7 @@ CMN_CSRCS = up_assert.c up_blocktask.c up_copystate.c up_createstack.c \
# Required AT91UC3 files
CHIP_ASRCS =
-CHIP_CSRCS = at91uc3_lowinit.c at91uc3_serial.c
+CHIP_CSRCS = at91uc3_lowconsole.c at91uc3_lowinit.c at91uc3_serial.c
# Configuration-dependent AT91UC3 files
diff --git a/nuttx/arch/avr/src/at91uc3/at91uc3_internal.h b/nuttx/arch/avr/src/at91uc3/at91uc3_internal.h
index 6013b2f5b..54c0d2c43 100755
--- a/nuttx/arch/avr/src/at91uc3/at91uc3_internal.h
+++ b/nuttx/arch/avr/src/at91uc3/at91uc3_internal.h
@@ -59,17 +59,27 @@
************************************************************************************/
/************************************************************************************
- * Name: at91uc3_clkinit
+ * Name: up_clkinit
*
* Description:
* Initialiaze clock/PLL settings per the definitions in the board.h file.
*
************************************************************************************/
-extern void at91uc3_clkinitialize(void);
+extern void up_clkinitialize(void);
/************************************************************************************
- * Name: at91uc3_boardinit
+ * Name: up_consoleinit
+ *
+ * Description:
+ * Initialize a console for debug output.
+ *
+ ************************************************************************************/
+
+extern void up_consoleinit(void);
+
+/************************************************************************************
+ * Name: up_boardinit
*
* Description:
* This function must be provided by the board-specific logic in the directory
@@ -77,7 +87,7 @@ extern void at91uc3_clkinitialize(void);
*
************************************************************************************/
-extern void at91uc3_boardinitialize(void);
+extern void up_boardinitialize(void);
#endif /* __ARCH_AVR_SRC_AVR32_AT91UC3_INTERNAL_H */
diff --git a/nuttx/arch/avr/src/at91uc3/at91uc3_lowconsole.c b/nuttx/arch/avr/src/at91uc3/at91uc3_lowconsole.c
new file mode 100644
index 000000000..e12ee4cc7
--- /dev/null
+++ b/nuttx/arch/avr/src/at91uc3/at91uc3_lowconsole.c
@@ -0,0 +1,105 @@
+/**************************************************************************
+ * arch/avr/src/at91uc3/at91uc3_lowconsole.c
+ *
+ * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * 3. Neither the name NuttX nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ **************************************************************************/
+
+/**************************************************************************
+ * Included Files
+ **************************************************************************/
+
+#include <nuttx/config.h>
+
+#include "at91uc3_config.h"
+#include "up_internal.h"
+#include "at91uc3_internal.h"
+
+/**************************************************************************
+ * Private Definitions
+ **************************************************************************/
+
+/**************************************************************************
+ * Private Types
+ **************************************************************************/
+
+/**************************************************************************
+ * Private Function Prototypes
+ **************************************************************************/
+
+/**************************************************************************
+ * Global Variables
+ **************************************************************************/
+
+/**************************************************************************
+ * Private Variables
+ **************************************************************************/
+
+/**************************************************************************
+ * Private Functions
+ **************************************************************************/
+
+/**************************************************************************
+ * Public Functions
+ **************************************************************************/
+
+/************************************************************************************
+ * Name: up_consoleinit
+ *
+ * Description:
+ * Initialize a console for debug output.
+ *
+ ************************************************************************************/
+
+void up_consoleinit(void)
+{
+#warning "Not Implemented"
+}
+
+/************************************************************************************
+ * Name: up_lowputc
+ *
+ * Description:
+ * Output one byte on the serial console
+ *
+ ************************************************************************************/
+
+void up_lowputc(char ch)
+{
+#ifdef HAVE_SERIAL_CONSOLE
+ /* Wait until the TX data register is empty */
+#warning "Not Implemented"
+
+ /* Then send the character */
+#warning "Not Implemented"
+#endif
+}
+
diff --git a/nuttx/arch/avr/src/at91uc3/at91uc3_lowinit.c b/nuttx/arch/avr/src/at91uc3/at91uc3_lowinit.c
index fc2f38e32..38aa67937 100644
--- a/nuttx/arch/avr/src/at91uc3/at91uc3_lowinit.c
+++ b/nuttx/arch/avr/src/at91uc3/at91uc3_lowinit.c
@@ -85,17 +85,23 @@ void up_lowinit(void)
{
/* Initialize MCU clocking */
- at91uc3_clkinitialize();
+ up_clkinitialize();
+
+ /* Initialize a console */
+
+ up_consoleinit();
/* Perform early serial initialization (so that we will have debug output
- * available as soon as possible.
+ * available as soon as possible).
*/
+#ifdef CONFIG_USE_SERIALDRIVER
up_earlyserialinit();
+#endif
/* Perform board-level initialization */
- at91uc3_boardinitialize();
+ up_boardinitialize();
}
diff --git a/nuttx/arch/avr/src/at91uc3/at91uc3_serial.c b/nuttx/arch/avr/src/at91uc3/at91uc3_serial.c
index f5d80ebf9..8936298d2 100644
--- a/nuttx/arch/avr/src/at91uc3/at91uc3_serial.c
+++ b/nuttx/arch/avr/src/at91uc3/at91uc3_serial.c
@@ -902,21 +902,3 @@ int up_putc(int ch)
#endif /* CONFIG_USE_SERIALDRIVER */
-/**************************************************************************
- * Name: up_lowputc
- *
- * Description:
- * Output one byte on the serial console
- *
- **************************************************************************/
-
-void up_lowputc(char ch)
-{
-#ifdef HAVE_SERIAL_CONSOLE
- /* Wait until the TX data register is empty */
-#warning "Not Implemented"
-
- /* Then send the character */
-#warning "Not Implemented"
-#endif
-}
diff --git a/nuttx/configs/avr32dev1/src/avr32dev1_internal.h b/nuttx/configs/avr32dev1/src/avr32dev1_internal.h
index b0fedd751..0388c01b8 100755
--- a/nuttx/configs/avr32dev1/src/avr32dev1_internal.h
+++ b/nuttx/configs/avr32dev1/src/avr32dev1_internal.h
@@ -65,14 +65,14 @@
************************************************************************************/
/************************************************************************************
- * Name: avr32dev1_ledinitialize
+ * Name: up_ledinitialize
*
* Description:
* Configure on-board LEDs if LED support has been selected.
************************************************************************************/
#ifdef CONFIG_ARCH_LEDS
-extern void avr32dev1_ledinitialize(void);
+extern void up_ledinitialize(void);
#endif
#endif /* __ASSEMBLY__ */
diff --git a/nuttx/configs/avr32dev1/src/up_boot.c b/nuttx/configs/avr32dev1/src/up_boot.c
index f75cda398..b0eae956e 100755
--- a/nuttx/configs/avr32dev1/src/up_boot.c
+++ b/nuttx/configs/avr32dev1/src/up_boot.c
@@ -63,7 +63,7 @@
************************************************************************************/
/************************************************************************************
- * Name: at91uc3_boardinitialize
+ * Name: up_boardinitialize
*
* Description:
* All AVR32 architectures must provide the following entry point. This entry point
@@ -72,13 +72,13 @@
*
************************************************************************************/
-void at91uc3_boardinitialize(void)
+void up_boardinitialize(void)
{
/* Configure SPI chip selects */
/* Configure on-board LEDs if LED support has been selected. */
#ifdef CONFIG_ARCH_LEDS
- avr32dev1_ledinitialize();
+ up_ledinitialize();
#endif
}
diff --git a/nuttx/configs/avr32dev1/src/up_leds.c b/nuttx/configs/avr32dev1/src/up_leds.c
index 62ccd5a88..5118ccde6 100755
--- a/nuttx/configs/avr32dev1/src/up_leds.c
+++ b/nuttx/configs/avr32dev1/src/up_leds.c
@@ -100,10 +100,10 @@
****************************************************************************/
/****************************************************************************
- * Name: up_ledinit
+ * Name: up_ledinitialize
****************************************************************************/
-void up_ledinit(void)
+void up_ledinitialize(void)
{
# warning "Not implemented"
}