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/avr/src | |
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/avr/src')
-rw-r--r-- | nuttx/arch/avr/src/at32uc3/at32uc3_config.h | 28 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c | 6 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c | 6 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at32uc3/at32uc3_serial.c | 10 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_config.h | 32 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_lowinit.c | 6 | ||||
-rw-r--r-- | nuttx/arch/avr/src/at90usb/at90usb_serial.c | 10 | ||||
-rw-r--r-- | nuttx/arch/avr/src/atmega/atmega_config.h | 32 | ||||
-rw-r--r-- | nuttx/arch/avr/src/atmega/atmega_lowinit.c | 6 | ||||
-rw-r--r-- | nuttx/arch/avr/src/atmega/atmega_serial.c | 10 | ||||
-rw-r--r-- | nuttx/arch/avr/src/common/up_initialize.c | 35 | ||||
-rw-r--r-- | nuttx/arch/avr/src/common/up_internal.h | 8 |
12 files changed, 126 insertions, 63 deletions
diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_config.h b/nuttx/arch/avr/src/at32uc3/at32uc3_config.h index 004c8b2d15..72536083a7 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_config.h +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_config.h @@ -146,13 +146,27 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) || !defined(HAVE_RS232_DEVICE) -# 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 +# elif defined(HAVE_RS232_DEVICE) +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# else +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# endif +#endig /* If GPIO IRQ support is defined, then a set of GPIOs must all be included */ diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c b/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c index 37a4c48dcd..2fb04a1ca1 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_lowconsole.c @@ -1,8 +1,8 @@ /****************************************************************************** * arch/avr/src/at32uc3/at32uc3_lowconsole.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -362,7 +362,7 @@ void up_consoleinit(void) * by up_earlyserialinit()). */ -#if defined(HAVE_SERIAL_CONSOLE) && !defined(CONFIG_USE_EARLYSERIALINIT) +#if defined(HAVE_SERIAL_CONSOLE) && !defined(USE_EARLYSERIALINIT) usart_configure(AVR32_CONSOLE_BASE, AVR32_CONSOLE_BAUD, AVR32_CONSOLE_PARITY, AVR32_CONSOLE_BITS, (bool)AVR32_CONSOLE_2STOP); #endif diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c b/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c index d8d62488a2..d1281491c6 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_lowinit.c @@ -1,8 +1,8 @@ /************************************************************************** * arch/avr/src/at32uc3/at32uc3_lowinit.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -95,7 +95,7 @@ void up_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c b/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c index e0c2bae48b..ff5c5490d0 100644 --- a/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c +++ b/nuttx/arch/avr/src/at32uc3/at32uc3_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/at32uc3/at32uc3_serial.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -78,7 +78,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which USART with be tty0/console and which tty1? */ @@ -808,7 +808,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -835,5 +835,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/at90usb/at90usb_config.h b/nuttx/arch/avr/src/at90usb/at90usb_config.h index 7505c162d2..e6d2fb89ed 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_config.h +++ b/nuttx/arch/avr/src/at90usb/at90usb_config.h @@ -1,8 +1,8 @@ /************************************************************************************ * arch/avr/src/at90usb/at90usb_config.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -65,13 +65,27 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) || !defined(HAVE_USART_DEVICE) -# 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 +# elif defined(HAVE_USART_DEVICE) +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# else +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# endif +#endig /************************************************************************************ * Public Types diff --git a/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c b/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c index f7a1b921e1..5f8964f6c6 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_lowinit.c @@ -1,8 +1,8 @@ /************************************************************************** * arch/avr/src/at90usb/at90usb_lowinit.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -142,7 +142,7 @@ void up_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/avr/src/at90usb/at90usb_serial.c b/nuttx/arch/avr/src/at90usb/at90usb_serial.c index 88769bc0b5..f75f380620 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_serial.c +++ b/nuttx/arch/avr/src/at90usb/at90usb_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/at90usb/at90usb_serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -77,7 +77,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /**************************************************************************** * Private Types @@ -588,7 +588,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -615,5 +615,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/atmega/atmega_config.h b/nuttx/arch/avr/src/atmega/atmega_config.h index bf314ad49b..e0a7968cc5 100644 --- a/nuttx/arch/avr/src/atmega/atmega_config.h +++ b/nuttx/arch/avr/src/atmega/atmega_config.h @@ -1,8 +1,8 @@ /************************************************************************************ * arch/avr/src/atmega/atmega_config.h * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -70,13 +70,27 @@ /* Determine which (if any) console driver to use */ -#if CONFIG_NFILE_DESCRIPTORS == 0 || defined(CONFIG_DEV_LOWCONSOLE) || !defined(HAVE_USART_DEVICE) -# 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 +# elif defined(HAVE_USART_DEVICE) +# define USE_SERIALDRIVER 1 +# define USE_EARLYSERIALINIT 1 +# else +# undef USE_SERIALDRIVER +# undef USE_EARLYSERIALINIT +# endif +#endig /************************************************************************************ * Public Types diff --git a/nuttx/arch/avr/src/atmega/atmega_lowinit.c b/nuttx/arch/avr/src/atmega/atmega_lowinit.c index bb0a4d5127..8456f0e110 100644 --- a/nuttx/arch/avr/src/atmega/atmega_lowinit.c +++ b/nuttx/arch/avr/src/atmega/atmega_lowinit.c @@ -1,8 +1,8 @@ /************************************************************************** * arch/avr/src/atmega/atmega_lowinit.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -142,7 +142,7 @@ void up_lowinit(void) * available as soon as possible). */ -#ifdef CONFIG_USE_EARLYSERIALINIT +#ifdef USE_EARLYSERIALINIT up_earlyserialinit(); #endif diff --git a/nuttx/arch/avr/src/atmega/atmega_serial.c b/nuttx/arch/avr/src/atmega/atmega_serial.c index 813fa9e8f2..b3106b1d0b 100644 --- a/nuttx/arch/avr/src/atmega/atmega_serial.c +++ b/nuttx/arch/avr/src/atmega/atmega_serial.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/atmega/atmega_serial.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -77,7 +77,7 @@ * provide some minimal implementation of up_putc. */ -#ifdef CONFIG_USE_SERIALDRIVER +#ifdef USE_SERIALDRIVER /* Which USART with be tty0/console and which tty1? */ @@ -982,7 +982,7 @@ int up_putc(int ch) return ch; } -#else /* CONFIG_USE_SERIALDRIVER */ +#else /* USE_SERIALDRIVER */ /**************************************************************************** * Name: up_putc @@ -1009,5 +1009,5 @@ int up_putc(int ch) return ch; } -#endif /* CONFIG_USE_SERIALDRIVER */ +#endif /* USE_SERIALDRIVER */ diff --git a/nuttx/arch/avr/src/common/up_initialize.c b/nuttx/arch/avr/src/common/up_initialize.c index abbff8532d..eed1b41359 100644 --- a/nuttx/arch/avr/src/common/up_initialize.c +++ b/nuttx/arch/avr/src/common/up_initialize.c @@ -1,8 +1,8 @@ /**************************************************************************** * arch/avr/src/common/up_initialize.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 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 @@ -57,13 +57,24 @@ * This will probably have to be revisited someday. */ -#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 /**************************************************************************** * Private Types @@ -162,12 +173,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/avr/src/common/up_internal.h b/nuttx/arch/avr/src/common/up_internal.h index e65b5627d9..bc62be720d 100644 --- a/nuttx/arch/avr/src/common/up_internal.h +++ b/nuttx/arch/avr/src/common/up_internal.h @@ -172,6 +172,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 + /* Defined in chip/xxx_timerisr.c */ extern void up_timerinit(void); |