uart: update c_cflag of termios without erasing existing set value when setting baud... 74/168374/1
authorSegwon <segwon.han@samsung.com>
Wed, 24 Jan 2018 08:12:50 +0000 (17:12 +0900)
committerSegwon Han <segwon.han@samsung.com>
Fri, 26 Jan 2018 05:58:41 +0000 (05:58 +0000)
Change-Id: I6976042de284fd991eebab9a812d5ce5405fe80c
Signed-off-by: Segwon <segwon.han@samsung.com>
src/interface/peripheral_interface_uart.c

index afa4aa0..7ebcf61 100644 (file)
@@ -145,7 +145,8 @@ int peripheral_interface_uart_set_baud_rate(peripheral_uart_h uart, peripheral_u
        ret = tcgetattr(uart->fd, &tio);
        CHECK_ERROR(ret != 0);
 
-       tio.c_cflag = peripheral_uart_br[baud];
+       tio.c_cflag &= ~__MAX_BAUD;
+       tio.c_cflag |= peripheral_uart_br[baud];
 
        peripheral_interface_uart_flush(uart);