Add logic so that a RAM log can be used in place of a console device

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4380 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-02-11 03:50:52 +00:00
parent ddd6b7d383
commit f03655f43a
85 changed files with 732 additions and 380 deletions
+8 -4
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* common/up_initialize.c
*
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -162,12 +162,16 @@ void up_initialize(void)
/* Initialize the serial device driver */
#ifdef CONFIG_USE_SERIALDRIVER
#ifdef USE_SERIALDRIVER
up_serialinit();
#endif
#ifdef CONFIG_USE_LOWCONSOLE
/* Initialize the console device driver */
#if defined(CONFIG_DEV_LOWCONSOLE)
lowconsole_init();
#elif defined(CONFIG_RAMLOG_CONSOLE)
ramlog_consoleinit();
#endif
/* Initialize the netwok */
+14 -8
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* common/up_internal.h
*
* Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -64,11 +64,11 @@
#if defined(CONFIG_Z16_LOWPUTC) || defined(CONFIG_Z16_LOWGETC) || \
CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE)
# define CONFIG_USE_LOWCONSOLE 1
# define CONFIG_USE_LOWUARTINIT 1
# define USE_LOWCONSOLE 1
# define USE_LOWUARTINIT 1
#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
# define CONFIG_USE_SERIALDRIVER 1
# define CONFIG_USE_EARLYSERIALINIT 1
# define USE_SERIALDRIVER 1
# define USE_EARLYSERIALINIT 1
#endif
/* Macros for portability */
@@ -131,15 +131,21 @@ void up_addregion(void);
/* Defined in up_serial.c */
#ifdef CONFIG_USE_SERIALDRIVER
#ifdef USE_SERIALDRIVER
extern void up_earlyserialinit(void);
extern void up_serialinit(void);
#endif
#ifdef CONFIG_USE_LOWCONSOLE
#ifdef USE_LOWCONSOLE
extern void lowconsole_init(void);
#endif
/* Defined in drivers/ramlog.c */
#ifdef CONFIG_RAMLOG_CONSOLE
extern void ramlog_consoleinit(void);
#endif
/* Defined in up_timerisr.c */
extern void up_timerinit(void);
+6 -6
View File
@@ -2,8 +2,8 @@
* arch/z16/src/z16f/z16f_head.S
* Z16F Reset Entry Point
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -55,9 +55,9 @@
#ifdef CONFIG_ARCH_LEDS
xref _up_ledinit:EROM
#endif
#if defined(CONFIG_USE_LOWUARTINIT)
#if defined(USE_LOWUARTINIT)
xref _z16f_lowuartinit:EROM
#elif defined(CONFIG_USE_EARLYSERIALINIT)
#elif defined(USE_EARLYSERIALINIT)
xref _up_earlyserialinit:EROM
#endif
xref _os_start:EROM
@@ -161,7 +161,7 @@ _z16f_reset:
#endif
/* Perform VERY early UART initialization so that we can use it here */
#ifdef CONFIG_USE_LOWUARTINIT
#ifdef USE_LOWUARTINIT
call _z16f_lowuartinit /* Initialize the UART for debugging */
#endif
/* Initialize the hardware stack overflow register */
@@ -214,7 +214,7 @@ _z16f_reset8:
call _z16f_lowinit /* Perform low-level hardware initialization */
#ifdef CONFIG_USE_EARLYSERIALINIT
#ifdef USE_EARLYSERIALINIT
/* Perform early serial initialization */
call _up_earlyserialinit
+4 -4
View File
@@ -2,8 +2,8 @@
* arch/z16/src/z16f/z16f_lowuart.asm
* Z16F UART management
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2008, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -42,7 +42,7 @@
#include "chip/chip.h"
#include "common/up_internal.h"
#ifdef CONFIG_USE_LOWUARTINIT
#ifdef USE_LOWUARTINIT
/*************************************************************************
* External References / External Definitions
@@ -121,7 +121,7 @@ _z16f_lowuartinit:
ld.b Z16F_UART0_CTL0, r0 /* Z16F_UART0_CTL0 = %c0 */
#endif
ret /* Return */
#endif /* CONFIG_USE_LOWUARTINIT */
#endif /* USE_LOWUARTINIT */
/*************************************************************************
* Name: _up_lowputc
+5 -5
View File
@@ -1,8 +1,8 @@
/****************************************************************************
* arch/z16/src/z16f/z16f_serial.c
*
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -57,7 +57,7 @@
#include "os_internal.h"
#include "up_internal.h"
#ifdef CONFIG_USE_SERIALDRIVER
#ifdef USE_SERIALDRIVER
/****************************************************************************
* Definitions
@@ -737,7 +737,7 @@ int up_putc(int ch)
return ch;
}
#else /* CONFIG_USE_SERIALDRIVER */
#else /* USE_SERIALDRIVER */
/****************************************************************************
* Definitions
@@ -803,4 +803,4 @@ int up_putc(int ch)
return ch;
}
#endif /* CONFIG_USE_SERIALDRIVER */
#endif /* USE_SERIALDRIVER */