mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 11:43:33 +08:00
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:
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/hc/src/common/up_initialize.c
|
||||
*
|
||||
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2009-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
|
||||
@@ -148,12 +148,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 */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/hc/src/common/up_internal.h
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 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
|
||||
@@ -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 */
|
||||
|
||||
@@ -167,6 +178,12 @@ extern void lowconsole_init(void);
|
||||
# define lowconsole_init()
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_RAMLOG_CONSOLE
|
||||
extern void ramlog_consoleinit(void);
|
||||
#else
|
||||
# define ramlog_consoleinit()
|
||||
#endif
|
||||
|
||||
extern void up_lowputc(char ch);
|
||||
extern void up_puts(const char *str);
|
||||
extern void up_lowputs(const char *str);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/hc/src/m9s12/m9s12_serial.c
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 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
|
||||
@@ -54,13 +54,13 @@
|
||||
* disabled if we are using ROM-resident serial I/O
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_SERIAL_CONSOLE) || !defined(CONFIG_USE_SERIALDRIVER) || \
|
||||
#if !defined(HAVE_SERIAL_CONSOLE) || !defined(USE_SERIALDRIVER) || \
|
||||
defined(CONFIG_HCS12_SERIALMON)
|
||||
# undef CONFIG_USE_SERIALDRIVER
|
||||
# undef CONFIG_USE_EARLYSERIALINIT
|
||||
# undef USE_SERIALDRIVER
|
||||
# undef USE_EARLYSERIALINIT
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USE_SERIALDRIVER
|
||||
#ifdef USE_SERIALDRIVER
|
||||
|
||||
/* Yes, which is ttyS0 and which is ttyS1 */
|
||||
|
||||
@@ -735,7 +735,7 @@ static bool up_txempty(struct uart_dev_s *dev)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USE_EARLYSERIALINIT
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
void up_earlyserialinit(void)
|
||||
{
|
||||
/* Disable all UARTS */
|
||||
@@ -813,7 +813,7 @@ int up_putc(int ch)
|
||||
return ch;
|
||||
}
|
||||
|
||||
#else /* CONFIG_USE_SERIALDRIVER */
|
||||
#else /* USE_SERIALDRIVER */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_putc
|
||||
@@ -841,4 +841,4 @@ int up_putc(int ch)
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USE_SERIALDRIVER */
|
||||
#endif /* USE_SERIALDRIVER */
|
||||
|
||||
Reference in New Issue
Block a user