microRTPS: transport: fix UART configuration

This commit is contained in:
TSC21 2021-07-30 14:53:42 +02:00 committed by Nuno Marques
parent 4b6646c5f3
commit 21953daa3b
1 changed files with 6 additions and 2 deletions

View File

@ -373,11 +373,15 @@ int UART_node::init()
// Flow control
if (_hw_flow_control) {
// HW flow control
uart_config.c_lflag |= CRTSCTS;
uart_config.c_cflag |= CRTSCTS;
uart_config.c_iflag &= ~(IXON | IXOFF | IXANY);
} else if (_sw_flow_control) {
// SW flow control
uart_config.c_cflag &= ~CRTSCTS;
uart_config.c_lflag |= (IXON | IXOFF | IXANY);
} else {
uart_config.c_cflag &= ~CRTSCTS;
uart_config.c_iflag &= ~(IXON | IXOFF | IXANY);
}
// Set baud rate