diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-02-11 03:50:52 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-02-11 03:50:52 +0000 |
commit | 910a9ac9dde1ea38e5bb9e0101cd3687d53c1518 (patch) | |
tree | 6c5b47ab79d40800d497f8a470aad5aa569ff9d6 /nuttx/arch/arm/src/common | |
parent | 188f4528e6675180bcf33ac8703e08da2a26d38b (diff) |
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
Diffstat (limited to 'nuttx/arch/arm/src/common')
-rw-r--r-- | nuttx/arch/arm/src/common/up_initialize.c | 10 | ||||
-rw-r--r-- | nuttx/arch/arm/src/common/up_internal.h | 41 |
2 files changed, 36 insertions, 15 deletions
diff --git a/nuttx/arch/arm/src/common/up_initialize.c b/nuttx/arch/arm/src/common/up_initialize.c index 167111ddb2..9d7ba0f193 100644 --- a/nuttx/arch/arm/src/common/up_initialize.c +++ b/nuttx/arch/arm/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/arm/src/common/up_initialize.c * - * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2010, 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 @@ -149,12 +149,14 @@ void up_initialize(void) devnull_register(); /* Standard /dev/null */ #endif - /* Initialize the serial device driver */ + /* Initialize the console device driver */ -#ifdef CONFIG_USE_SERIALDRIVER +#if defined(USE_SERIALDRIVER) up_serialinit(); #elif defined(CONFIG_DEV_LOWCONSOLE) lowconsole_init(); +#elif defined(CONFIG_RAMLOG_CONSOLE) + ramlog_consoleinit(); #endif /* Initialize the netwok */ diff --git a/nuttx/arch/arm/src/common/up_internal.h b/nuttx/arch/arm/src/common/up_internal.h index 306a44b495..6f98ac04d3 100644 --- a/nuttx/arch/arm/src/common/up_internal.h +++ b/nuttx/arch/arm/src/common/up_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * common/up_internal.h * - * Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __UP_INTERNAL_H -#define __UP_INTERNAL_H +#ifndef __ARCH_ARM_SRC_COMMON_UP_INTERNAL_H +#define __ARCH_ARM_SRC_COMMON_UP_INTERNAL_H /**************************************************************************** * Included Files @@ -62,13 +62,24 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) -# undef CONFIG_USE_SERIALDRIVER -# undef CONFIG_USE_EARLYSERIALINIT -#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0 -# define CONFIG_USE_SERIALDRIVER 1 -# define CONFIG_USE_EARLYSERIALINIT 1 -#endif +#if !defined(CONFIG_DEV_CONSOLE) || CONFIG_NFILE_DESCRIPTORS == 0 +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# undef CONFIG_RAMLOG_CONSOLE +#else +# if defined(CONFIG_RAMLOG_CONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# undef CONFIG_DEV_LOWCONSOLE +# elif defined(CONFIG_DEV_LOWCONSOLE) +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# else +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# endif +#endig /* Check if an interrupt stack size is configured */ @@ -286,6 +297,14 @@ extern void lowconsole_init(void); # define lowconsole_init() #endif +/* Defined in drivers/ramlog.c */ + +#ifdef CONFIG_RAMLOG_CONSOLE +extern void ramlog_consoleinit(void); +#else +# define ramlog_consoleinit() +#endif + /* DMA **********************************************************************/ #ifdef CONFIG_ARCH_DMA @@ -364,4 +383,4 @@ extern size_t up_check_tcbstack_remain(FAR _TCB); #endif /* __ASSEMBLY__ */ -#endif /* __UP_INTERNAL_H */ +#endif /* __ARCH_ARM_SRC_COMMON_UP_INTERNAL_H */ |