mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 09:33: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/z80/src/common/up_initialize.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
* Copyright (C) 2007-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
|
||||
@@ -153,14 +153,18 @@ void up_initialize(void)
|
||||
|
||||
/* Initialize the serial device driver */
|
||||
|
||||
#ifdef CONFIG_USE_LOWUARTINIT
|
||||
#ifdef USE_LOWUARTINIT
|
||||
up_lowuartinit();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USE_SERIALDRIVER
|
||||
/* Initialize the console device driver */
|
||||
|
||||
#if defined(USE_SERIALDRIVER)
|
||||
up_serialinit();
|
||||
#elif defined(CONFIG_DEV_LOWCONSOLE)
|
||||
lowconsole_init();
|
||||
#elif defined(CONFIG_RAMLOG_CONSOLE)
|
||||
ramlog_consoleinit();
|
||||
#endif
|
||||
|
||||
/* Initialize the netwok */
|
||||
|
||||
@@ -69,15 +69,15 @@
|
||||
/* Determine which (if any) console driver to use */
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE)
|
||||
# undef CONFIG_USE_SERIALDRIVER
|
||||
# undef USE_SERIALDRIVER
|
||||
# ifdef CONFIG_HAVE_LOWUARTINIT
|
||||
# define CONFIG_USE_LOWUARTINIT 1
|
||||
# define USE_LOWUARTINIT 1
|
||||
# else
|
||||
# undef CONFIG_USE_LOWUARTINIT
|
||||
# undef USE_LOWUARTINIT
|
||||
# endif
|
||||
#elif defined(CONFIG_DEV_CONSOLE) && CONFIG_NFILE_DESCRIPTORS > 0
|
||||
# define CONFIG_USE_SERIALDRIVER 1
|
||||
# undef CONFIG_USE_LOWUARTINIT
|
||||
# define USE_SERIALDRIVER 1
|
||||
# undef USE_LOWUARTINIT
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -105,7 +105,7 @@ extern "C" {
|
||||
EXTERN void up_irqinitialize(void);
|
||||
EXTERN int up_timerisr(int irq, FAR chipreg_t *regs);
|
||||
|
||||
#ifdef CONFIG_USE_LOWUARTINIT
|
||||
#ifdef USE_LOWUARTINIT
|
||||
EXTERN void up_lowuartinit(void);
|
||||
#endif
|
||||
|
||||
@@ -125,7 +125,7 @@ void up_addregion(void);
|
||||
|
||||
/* Defined in up_serial.c */
|
||||
|
||||
#ifdef CONFIG_USE_SERIALDRIVER
|
||||
#ifdef USE_SERIALDRIVER
|
||||
EXTERN void up_serialinit(void);
|
||||
#else
|
||||
# define up_serialinit()
|
||||
@@ -139,6 +139,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
|
||||
|
||||
/* Low level string output */
|
||||
|
||||
extern void up_puts(const char *str);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/ez80/ez80_loweruart.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
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "chip/chip.h"
|
||||
#include "common/up_internal.h"
|
||||
|
||||
#ifdef CONFIG_USE_LOWUARTINIT
|
||||
#ifdef USE_LOWUARTINIT
|
||||
|
||||
/****************************************************************************
|
||||
* Private Definitions
|
||||
@@ -253,4 +253,4 @@ void up_lowuartinit(void)
|
||||
#endif /* HAVE_SERIAL */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USE_LOWUARTINIT */
|
||||
#endif /* USE_LOWUARTINIT */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/ez08/ez80_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
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#ifdef CONFIG_USE_SERIALDRIVER
|
||||
#ifdef USE_SERIALDRIVER
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
@@ -774,7 +774,7 @@ int up_putc(int ch)
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* CONFIG_USE_SERIALDRIVER */
|
||||
#else /* USE_SERIALDRIVER */
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
@@ -839,4 +839,4 @@ int up_putc(int ch)
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USE_SERIALDRIVER */
|
||||
#endif /* USE_SERIALDRIVER */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/z8/z8_loweruart.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
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "chip/chip.h"
|
||||
#include "common/up_internal.h"
|
||||
|
||||
#ifdef CONFIG_USE_LOWUARTINIT
|
||||
#ifdef USE_LOWUARTINIT
|
||||
|
||||
extern uint32_t get_freq(void);
|
||||
|
||||
@@ -127,4 +127,4 @@ void up_lowuartinit(void)
|
||||
putreg8(0xc0, U1CTL0); /* Transmit enable, Receive enable, no Parity, 1 Stop bit */
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_USE_LOWUARTINIT */
|
||||
#endif /* USE_LOWUARTINIT */
|
||||
@@ -1,8 +1,8 @@
|
||||
/****************************************************************************
|
||||
* arch/z80/src/z8/z8_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
|
||||
@@ -58,7 +58,7 @@
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
#ifdef CONFIG_USE_SERIALDRIVER
|
||||
#ifdef USE_SERIALDRIVER
|
||||
|
||||
extern uint32_t get_freq(void);
|
||||
|
||||
@@ -790,7 +790,7 @@ int up_putc(int ch)
|
||||
return ch;
|
||||
}
|
||||
|
||||
#else /* CONFIG_USE_SERIALDRIVER */
|
||||
#else /* USE_SERIALDRIVER */
|
||||
|
||||
/****************************************************************************
|
||||
* Definitions
|
||||
@@ -856,4 +856,4 @@ int up_putc(int ch)
|
||||
return ch;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USE_SERIALDRIVER */
|
||||
#endif /* USE_SERIALDRIVER */
|
||||
|
||||
Reference in New Issue
Block a user