diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-19 02:26:04 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-19 02:26:04 +0000 |
commit | 01f422d3de8c1d02b4183b9bbbbf91eb0d42a58f (patch) | |
tree | 85d401df1e9587373f9d3863385c87b17b637d86 | |
parent | 0fe675d58c8be8b7eaafc8c36cbd096c3738a761 (diff) | |
download | px4-nuttx-01f422d3de8c1d02b4183b9bbbbf91eb0d42a58f.tar.gz px4-nuttx-01f422d3de8c1d02b4183b9bbbbf91eb0d42a58f.tar.bz2 px4-nuttx-01f422d3de8c1d02b4183b9bbbbf91eb0d42a58f.zip |
Improve console configuration settings
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1518 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_lowputc.c | 8 | ||||
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_serial.c | 24 | ||||
-rw-r--r-- | nuttx/configs/skp16c26/ostest/defconfig | 4 | ||||
-rw-r--r-- | nuttx/configs/skp16c26/src/up_lcdconsole.c | 2 |
4 files changed, 27 insertions, 11 deletions
diff --git a/nuttx/arch/sh/src/m16c/m16c_lowputc.c b/nuttx/arch/sh/src/m16c/m16c_lowputc.c index 6c10a6468..43f9b1946 100644 --- a/nuttx/arch/sh/src/m16c/m16c_lowputc.c +++ b/nuttx/arch/sh/src/m16c/m16c_lowputc.c @@ -90,6 +90,12 @@ # undef HAVE_SERIALCONSOLE #endif +#if defined(HAVE_SERIALCONSOLE) && defined(CONFIG_LCD_CONSOLE) +# error "Both serial and LCD consoles are defined" +#elif !defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_LCD_CONSOLE) +# warning "No console is defined" +#endif + /* Select UART parameters for the selected console */ #ifdef HAVE_SERIALCONSOLE @@ -292,7 +298,7 @@ static inline void up_lowserialsetup(void) * **************************************************************************/ -#ifdef HAVE_SERIAL /* Assume needed if we have serial. See for e.g., up_lcd.c */ +#if defined(HAVE_SERIAL) && !defined(CONFIG_LCD_CONSOLE) void up_lowputc(char ch) { #ifdef HAVE_SERIALCONSOLE diff --git a/nuttx/arch/sh/src/m16c/m16c_serial.c b/nuttx/arch/sh/src/m16c/m16c_serial.c index 7ee4050f7..1db4b3ea1 100644 --- a/nuttx/arch/sh/src/m16c/m16c_serial.c +++ b/nuttx/arch/sh/src/m16c/m16c_serial.c @@ -106,27 +106,33 @@ /* Is there a serial console? */ #if defined(CONFIG_UART0_SERIAL_CONSOLE) && !defined(CONFIG_UART0_DISABLE) -# define HAVE_CONSOLE 1 +# define HAVE_SERIALCONSOLE 1 # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_UART2_SERIAL_CONSOLE #elif defined(CONFIG_UART1_SERIAL_CONSOLE) && !defined(CONFIG_UART1_DISABLE) -# define HAVE_CONSOLE 1 +# define HAVE_SERIALCONSOLE 1 # undef CONFIG_UART0_SERIAL_CONSOLE # undef CONFIG_UART2_SERIAL_CONSOLE #elif defined(CONFIG_UART2_SERIAL_CONSOLE) && !defined(CONFIG_UART2_DISABLE) -# define HAVE_CONSOLE 1 +# define HAVE_SERIALCONSOLE 1 # undef CONFIG_UART0_SERIAL_CONSOLE # undef CONFIG_UART1_SERIAL_CONSOLE #else # if defined(CONFIG_UART0_SERIAL_CONSOLE) || defined(CONFIG_UART1_SERIAL_CONSOLE)|| defined(CONFIG_UART2_SERIAL_CONSOLE) # error "Serial console selected, but corresponding UART not enabled" # endif -# undef HAVE_CONSOLE +# undef HAVE_SERIALCONSOLE # undef CONFIG_UART0_SERIAL_CONSOLE # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_UART2_SERIAL_CONSOLE #endif +#if defined(HAVE_SERIALCONSOLE) && defined(CONFIG_LCD_CONSOLE) +# error "Both serial and LCD consoles are defined" +#elif !defined(HAVE_SERIALCONSOLE) && !defined(CONFIG_LCD_CONSOLE) +# warning "No console is defined" +#endif + #ifdef CONFIG_USE_SERIALDRIVER /* Which UART with be tty0/console and which tty1 and tty2? */ @@ -469,7 +475,7 @@ static inline void up_restoreuartint(struct up_dev_s *priv, ubyte enables) * Name: up_waittxready ****************************************************************************/ -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIALCONSOLE static inline void up_waittxready(struct up_dev_s *priv) { int tmp; @@ -1091,7 +1097,7 @@ void up_earlyconsoleinit(void) /* Configuration whichever one is the console */ -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIALCONSOLE CONSOLE_DEV.isconsole = TRUE; up_setup(&CONSOLE_DEV); #endif @@ -1110,7 +1116,7 @@ void up_consoleinit(void) { /* Register the console */ -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIALCONSOLE (void)uart_register("/dev/console", &CONSOLE_DEV); #endif @@ -1137,7 +1143,7 @@ void up_consoleinit(void) int up_putc(int ch) { -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIALCONSOLE struct up_dev_s *priv = (struct up_dev_s*)CONSOLE_DEV.priv; ubyte ucon; @@ -1174,7 +1180,7 @@ int up_putc(int ch) int up_putc(int ch) { -#ifdef HAVE_CONSOLE +#ifdef HAVE_SERIALCONSOLE /* Check for LF */ if (ch == '\n') diff --git a/nuttx/configs/skp16c26/ostest/defconfig b/nuttx/configs/skp16c26/ostest/defconfig index c47819136..9218c7232 100644 --- a/nuttx/configs/skp16c26/ostest/defconfig +++ b/nuttx/configs/skp16c26/ostest/defconfig @@ -120,6 +120,10 @@ CONFIG_UART1_2STOP=0 CONFIG_UART2_2STOP=0 # +# Enable LCD console +CONFIG_LCD_CONSOLE=y + +# # General build options # # CONFIG_RRLOAD_BINARY - make the rrload binary format used with diff --git a/nuttx/configs/skp16c26/src/up_lcdconsole.c b/nuttx/configs/skp16c26/src/up_lcdconsole.c index 544d2ea38..e203c24d9 100644 --- a/nuttx/configs/skp16c26/src/up_lcdconsole.c +++ b/nuttx/configs/skp16c26/src/up_lcdconsole.c @@ -56,7 +56,7 @@ # undef HAVE_SERIALCONSOLE #endif -#if !defined(HAVE_SERIALCONSOLE) && defined(CONFIG_ARCH_LCD) +#if !defined(HAVE_SERIALCONSOLE) && defined(CONFIG_ARCH_LCD) && defined(CONFIG_LCD_CONSOLE) /************************************************************************************ * Definitions |