Merge pull request #10328 from kjbracey-arm/stdio_serial_option

Add option to disable default UART console
pull/10053/head
Cruz Monrreal 2019-04-09 14:03:41 -05:00 committed by GitHub
commit b419cfc3ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -12,12 +12,12 @@
}, },
"stdio-buffered-serial": { "stdio-buffered-serial": {
"help": "Use UARTSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.", "help": "(Applies if target.console-uart is true.) Use UARTSerial driver to obtain buffered serial I/O on stdin/stdout/stderr. If false, unbuffered serial_getc and serial_putc are used directly.",
"value": false "value": false
}, },
"stdio-baud-rate": { "stdio-baud-rate": {
"help": "Baud rate for stdio", "help": "(Applies if target.console-uart is true.) Baud rate for stdio",
"value": 9600 "value": 9600
}, },

View File

@ -261,7 +261,7 @@ MBED_WEAK FileHandle *mbed::mbed_override_console(int fd)
static FileHandle *default_console() static FileHandle *default_console()
{ {
#if DEVICE_SERIAL #if MBED_CONF_TARGET_CONSOLE_UART && DEVICE_SERIAL
# if MBED_CONF_PLATFORM_STDIO_BUFFERED_SERIAL # if MBED_CONF_PLATFORM_STDIO_BUFFERED_SERIAL
static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE); static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
# if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS # if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
@ -274,7 +274,7 @@ static FileHandle *default_console()
# else # else
static DirectSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE); static DirectSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
# endif # endif
#else // DEVICE_SERIAL #else // MBED_CONF_TARGET_CONSOLE_UART && DEVICE_SERIAL
static Sink console; static Sink console;
#endif #endif
return &console; return &console;

View File

@ -15,6 +15,10 @@
"bootloader_supported": false, "bootloader_supported": false,
"static_memory_defines": true, "static_memory_defines": true,
"config": { "config": {
"console-uart": {
"help": "Target has UART console on pins STDIO_UART_TX, STDIO_UART_RX. Value is only significant if target has SERIAL device.",
"value": true
},
"console-uart-flow-control": { "console-uart-flow-control": {
"help": "Console hardware flow control. Options: null, RTS, CTS, RTSCTS.", "help": "Console hardware flow control. Options: null, RTS, CTS, RTSCTS.",
"value": null "value": null