Skip to content

Minimal Console: Use static pin map #12071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions platform/source/mbed_retarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,18 @@ static void do_serial_init()
return;
}

serial_init(&stdio_uart, STDIO_UART_TX, STDIO_UART_RX);
static const serial_pinmap_t console_pinmap = get_uart_pinmap(STDIO_UART_TX, STDIO_UART_RX);
serial_init_direct(&stdio_uart, &console_pinmap);
serial_baud(&stdio_uart, MBED_CONF_PLATFORM_STDIO_BAUD_RATE);
#if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS
serial_set_flow_control(&stdio_uart, FlowControlRTS, STDIO_UART_RTS, NC);
static const serial_fc_pinmap_t fc_pinmap = get_uart_fc_pinmap(STDIO_UART_RTS, NC);
serial_set_flow_control_direct(&stdio_uart, FlowControlRTS, &fc_pinmap);
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS
serial_set_flow_control(&stdio_uart, FlowControlCTS, NC, STDIO_UART_CTS);
static const serial_fc_pinmap_t fc_pinmap = get_uart_fc_pinmap(NC, STDIO_UART_CTS);
serial_set_flow_control_direct(&stdio_uart, FlowControlCTS, &fc_pinmap);
#elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTSCTS
serial_set_flow_control(&stdio_uart, FlowControlRTSCTS, STDIO_UART_RTS, STDIO_UART_CTS);
static const serial_fc_pinmap_t fc_pinmap = get_uart_fc_pinmap(STDIO_UART_RTS, STDIO_UART_CTS);
serial_set_flow_control_direct(&stdio_uart, FlowControlRTSCTS, &fc_pinmap);
#endif
}

Expand Down