diff --git a/arch/sh/src/m16c/m16c_lowputc.c b/arch/sh/src/m16c/m16c_lowputc.c index 6c10a646838571b31bd42f1d0dd7717a10ad9942..43f9b1946ed49c63d488e44a2eeec87992ac28ce 100644 --- a/arch/sh/src/m16c/m16c_lowputc.c +++ b/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/arch/sh/src/m16c/m16c_serial.c b/arch/sh/src/m16c/m16c_serial.c index 7ee4050f79d537d78ebbec65ba9b887de3a9a6a6..1db4b3ea1ab6ed8473c2a44c3bf6b3da0e9d3980 100644 --- a/arch/sh/src/m16c/m16c_serial.c +++ b/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/configs/skp16c26/ostest/defconfig b/configs/skp16c26/ostest/defconfig index c47819136f47d79dc68e05ea7fac954f5bc865fc..9218c7232edbcca68a0f118c291409bad74e6c27 100644 --- a/configs/skp16c26/ostest/defconfig +++ b/configs/skp16c26/ostest/defconfig @@ -119,6 +119,10 @@ CONFIG_UART0_2STOP=0 CONFIG_UART1_2STOP=0 CONFIG_UART2_2STOP=0 +# +# Enable LCD console +CONFIG_LCD_CONSOLE=y + # # General build options # diff --git a/configs/skp16c26/src/up_lcdconsole.c b/configs/skp16c26/src/up_lcdconsole.c index 544d2ea38b1d51882d7a4a12ed15f4fd7ca30913..e203c24d9142cce047ac2478dc2f9d2a1d566d45 100644 --- a/configs/skp16c26/src/up_lcdconsole.c +++ b/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