mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-10-03 20:27:58 +00:00
system/cu: fix setting termios with parity
clear only the bits in c_cflag that will be set by cu
This commit is contained in:
parent
7d457b4d0b
commit
51c778bc5c
1 changed files with 4 additions and 2 deletions
|
|
@ -146,14 +146,16 @@ static int set_termios(int fd, int rate, enum parity_mode parity,
|
|||
|
||||
tio = g_tio_dev;
|
||||
|
||||
tio.c_cflag &= ~(PARENB | PARODD | CRTSCTS);
|
||||
|
||||
switch (parity)
|
||||
{
|
||||
case PARITY_EVEN:
|
||||
tio.c_cflag = PARENB;
|
||||
tio.c_cflag |= PARENB;
|
||||
break;
|
||||
|
||||
case PARITY_ODD:
|
||||
tio.c_cflag = PARENB | PARODD;
|
||||
tio.c_cflag |= PARENB | PARODD;
|
||||
break;
|
||||
|
||||
case PARITY_NONE:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue