mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
arch/arm/src/tiva: Modify preprocessor logic to support configs with no UART. Now similar to logic for other archs, such as arch/arm/src/a1x/a1x_lowputc.c and arch/arm/src/am335x/am335x_lowputc.c. This change eliminates compiler errors and warnings that were breaking the build with "No CONFIG_UARTn_SERIAL_CONSOLE Setting" when no UARTs / console were configured.
This commit is contained in:
committed by
Gregory Nutt
parent
a584865b47
commit
223722d6d3
@@ -118,12 +118,12 @@
|
|||||||
# define TIVA_CONSOLE_BITS CONFIG_UART7_BITS
|
# define TIVA_CONSOLE_BITS CONFIG_UART7_BITS
|
||||||
# define TIVA_CONSOLE_PARITY CONFIG_UART7_PARITY
|
# define TIVA_CONSOLE_PARITY CONFIG_UART7_PARITY
|
||||||
# define TIVA_CONSOLE_2STOP CONFIG_UART7_2STOP
|
# define TIVA_CONSOLE_2STOP CONFIG_UART7_2STOP
|
||||||
#elif !defined(CONFIG_NO_SERIAL_CONSOLE)
|
#elif defined(HAVE_SERIAL_CONSOLE)
|
||||||
# error "No CONFIG_UARTn_SERIAL_CONSOLE Setting"
|
# error "No CONFIG_UARTn_SERIAL_CONSOLE Setting"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Get LCRH settings */
|
/* Get LCRH settings */
|
||||||
#ifndef CONFIG_NO_SERIAL_CONSOLE
|
#ifdef HAVE_SERIAL_CONSOLE
|
||||||
|
|
||||||
# if TIVA_CONSOLE_BITS == 5
|
# if TIVA_CONSOLE_BITS == 5
|
||||||
# define UART_LCRH_NBITS UART_LCRH_WLEN_5BITS
|
# define UART_LCRH_NBITS UART_LCRH_WLEN_5BITS
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
|
|
||||||
# define UART_LCRH_VALUE (UART_LCRH_NBITS|UART_LCRH_PARITY|UART_LCRH_NSTOP|UART_LCRH_FEN)
|
# define UART_LCRH_VALUE (UART_LCRH_NBITS|UART_LCRH_PARITY|UART_LCRH_NSTOP|UART_LCRH_FEN)
|
||||||
|
|
||||||
#endif /* !CONFIG_NO_SERIAL_CONSOLE */
|
#endif /* HAVE_SERIAL_CONSOLE */
|
||||||
|
|
||||||
/* Calculate BAUD rate from the SYS clock:
|
/* Calculate BAUD rate from the SYS clock:
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -66,6 +66,12 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
/* If we are not using the serial driver for the console, then we
|
||||||
|
* still must provide some minimal implementation of up_putc.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef USE_SERIALDRIVER
|
||||||
|
|
||||||
/* Some sanity checks *******************************************************/
|
/* Some sanity checks *******************************************************/
|
||||||
|
|
||||||
/* Is there a UART enabled? */
|
/* Is there a UART enabled? */
|
||||||
@@ -76,12 +82,6 @@
|
|||||||
# error "No UARTs enabled"
|
# error "No UARTs enabled"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If we are not using the serial driver for the console, then we
|
|
||||||
* still must provide some minimal implementation of up_putc.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef USE_SERIALDRIVER
|
|
||||||
|
|
||||||
/* Which UART with be tty0/console and which tty1-7? The console will always
|
/* Which UART with be tty0/console and which tty1-7? The console will always
|
||||||
* be ttyS0. If there is no console then will use the lowest numbered UART.
|
* be ttyS0. If there is no console then will use the lowest numbered UART.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -151,18 +151,7 @@
|
|||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
# undef CONFIG_UART5_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART6_SERIAL_CONSOLE
|
# undef CONFIG_UART6_SERIAL_CONSOLE
|
||||||
# define HAVE_SERIAL_CONSOLE 1
|
# define HAVE_SERIAL_CONSOLE 1
|
||||||
#elif defined(CONFIG_NO_SERIAL_CONSOLE)
|
|
||||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART2_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART3_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART4_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART5_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART6_SERIAL_CONSOLE
|
|
||||||
# undef CONFIG_UART7_SERIAL_CONSOLE
|
|
||||||
# undef HAVE_SERIAL_CONSOLE
|
|
||||||
#else
|
#else
|
||||||
# warning "No valid CONFIG_UARTn_SERIAL_CONSOLE Setting"
|
|
||||||
# undef CONFIG_UART0_SERIAL_CONSOLE
|
# undef CONFIG_UART0_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART1_SERIAL_CONSOLE
|
# undef CONFIG_UART1_SERIAL_CONSOLE
|
||||||
# undef CONFIG_UART2_SERIAL_CONSOLE
|
# undef CONFIG_UART2_SERIAL_CONSOLE
|
||||||
|
|||||||
Reference in New Issue
Block a user