summaryrefslogtreecommitdiff
path: root/nuttx/arch/z16/src/z16f
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/z16f
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/z16f')
-rwxr-xr-xnuttx/arch/z16/src/z16f/z16f_head.S14
-rwxr-xr-xnuttx/arch/z16/src/z16f/z16f_lowuart.S6
-rw-r--r--nuttx/arch/z16/src/z16f/z16f_serial.c30
3 files changed, 34 insertions, 16 deletions
diff --git a/nuttx/arch/z16/src/z16f/z16f_head.S b/nuttx/arch/z16/src/z16f/z16f_head.S
index f6108c250..88b9ca5bb 100755
--- a/nuttx/arch/z16/src/z16f/z16f_head.S
+++ b/nuttx/arch/z16/src/z16f/z16f_head.S
@@ -40,6 +40,11 @@
#include <nuttx/config.h>
#include <arch/irq.h>
+#include "common/up_internal.h"
+
+/**************************************************************************
+ * Definitions
+ **************************************************************************/
/**************************************************************************
* External References / External Definitions
@@ -50,10 +55,9 @@
#ifdef CONFIG_ARCH_LEDS
xref _up_ledinit:EROM
#endif
-#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC) || CONFIG_NFILE_DESCRIPTORS == 0
+#if defined(CONFIG_USE_LOWUARTINIT)
xref _z16f_lowuartinit:EROM
-#endif
-#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
+#elif defined(CONFIG_USE_EARLYSERIALINIT)
xref _up_earlyserialinit:EROM
#endif
xref _os_start:EROM
@@ -157,7 +161,7 @@ _z16f_reset:
#endif
/* Perform VERY early UART initialization so that we can use it here */
-#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC) || CONFIG_NFILE_DESCRIPTORS == 0
+#ifdef CONFIG_USE_LOWUARTINIT
call _z16f_lowuartinit /* Initialize the UART for debugging */
#endif
/* Initialize the hardware stack overflow register */
@@ -210,7 +214,7 @@ _z16f_reset8:
call _z16f_lowinit /* Perform low-level hardware initialization */
-#if defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
+#ifdef CONFIG_USE_EARLYSERIALINIT
/* Perform early serial initialization */
call _up_earlyserialinit
diff --git a/nuttx/arch/z16/src/z16f/z16f_lowuart.S b/nuttx/arch/z16/src/z16f/z16f_lowuart.S
index bea5f25fc..1dedf16b3 100755
--- a/nuttx/arch/z16/src/z16f/z16f_lowuart.S
+++ b/nuttx/arch/z16/src/z16f/z16f_lowuart.S
@@ -40,8 +40,9 @@
#include <nuttx/config.h>
#include "chip/chip.h"
+#include "common/up_internal.h"
-#if defined(CONFIG_ARCH_LOWPUTC) || defined(CONFIG_ARCH_LOWGETC) || CONFIG_NFILE_DESCRIPTORS == 0
+#ifdef CONFIG_USE_LOWUARTINIT
/*************************************************************************
* External References / External Definitions
@@ -120,6 +121,7 @@ _z16f_lowuartinit:
ld.b Z16F_UART0_CTL0, r0 /* Z16F_UART0_CTL0 = %c0 */
#endif
ret /* Return */
+#endif /* CONFIG_USE_LOWUARTINIT */
/*************************************************************************
* Name: _up_lowputc
@@ -222,7 +224,5 @@ _up_lowgetc3: /* Return value in r0 */
ret /* Return */
#endif
-#endif /* CONFIG_ARCH_LOWPUTC || CONFIG_ARCH_LOWGETC */
-
end
diff --git a/nuttx/arch/z16/src/z16f/z16f_serial.c b/nuttx/arch/z16/src/z16f/z16f_serial.c
index ce40a497f..1446c5c57 100644
--- a/nuttx/arch/z16/src/z16f/z16f_serial.c
+++ b/nuttx/arch/z16/src/z16f/z16f_serial.c
@@ -55,14 +55,12 @@
#include "os_internal.h"
#include "up_internal.h"
-#if CONFIG_NFILE_DESCRIPTORS > 0
+#ifdef CONFIG_USE_SERIALDRIVER
/****************************************************************************
* Definitions
****************************************************************************/
-#define BASE_BAUD 115200
-
/* System clock frequency value from ZDS target settings */
extern _Erom unsigned long SYS_CLK_FREQ;
@@ -737,7 +735,7 @@ int up_putc(int ch)
return ch;
}
-#else /* CONFIG_NFILE_DESCRIPTORS > 0 */
+#else /* CONFIG_USE_SERIALDRIVER */
/****************************************************************************
* Definitions
@@ -756,10 +754,22 @@ int up_putc(int ch)
#endif
/****************************************************************************
+ * Private Function Prototypes
+ ****************************************************************************/
+
+/****************************************************************************
+ * Private Variables
+ ****************************************************************************/
+
+/****************************************************************************
* Private Functions
****************************************************************************/
-static void _up_putc(int ch)
+/****************************************************************************
+ * Name: z16f_putc
+ ****************************************************************************/
+
+static void z16f_putc(int ch)
{
int tmp;
for (tmp = 1000 ; tmp > 0 && !z16f_contrde(); tmp--);
@@ -770,6 +780,10 @@ static void _up_putc(int ch)
* Public Functions
****************************************************************************/
+/****************************************************************************
+ * Name: up_putc
+ ****************************************************************************/
+
int up_putc(int ch)
{
/* Check for LF */
@@ -778,13 +792,13 @@ int up_putc(int ch)
{
/* Output CR before LF */
- _up_putc('\r');
+ z16f_putc('\r');
}
/* Output character */
- _up_putc(ch);
+ z16f_putc(ch);
return ch;
}
-#endif /* CONFIG_NFILE_DESCRIPTORS > 0 */
+#endif /* CONFIG_USE_SERIALDRIVER */