From 8fbbf56c4df51ecd94bd82346e725db93b503ec4 Mon Sep 17 00:00:00 2001 From: Oleg Date: Mon, 19 Jul 2021 21:11:53 +0300 Subject: [PATCH] microRTPS: fix setting UART communication flags bitwise not should be used instead of logical not --- msg/templates/urtps/microRTPS_transport.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/msg/templates/urtps/microRTPS_transport.cpp b/msg/templates/urtps/microRTPS_transport.cpp index f77d590f883..45cef544f28 100644 --- a/msg/templates/urtps/microRTPS_transport.cpp +++ b/msg/templates/urtps/microRTPS_transport.cpp @@ -331,16 +331,16 @@ int UART_node::init() } // Set up the UART for non-canonical binary communication: 8 bits, 1 stop bit, no parity. - uart_config.c_iflag &= !(INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); + uart_config.c_iflag &= ~(INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); uart_config.c_iflag |= IGNBRK | IGNPAR; - uart_config.c_oflag &= !(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | NLDLY | VTDLY); + uart_config.c_oflag &= ~(OPOST | ONLCR | OCRNL | ONOCR | ONLRET | OFILL | NLDLY | VTDLY); uart_config.c_oflag |= NL0 | VT0; - uart_config.c_cflag &= !(CSIZE | CSTOPB | PARENB); + uart_config.c_cflag &= ~(CSIZE | CSTOPB | PARENB); uart_config.c_cflag |= CS8 | CREAD | CLOCAL; - uart_config.c_lflag &= !(ISIG | ICANON | ECHO | TOSTOP | IEXTEN); + uart_config.c_lflag &= ~(ISIG | ICANON | ECHO | TOSTOP | IEXTEN); // Flow control if (hw_flow_control) {