This is an automated email from the ASF dual-hosted git repository. aguettouche pushed a commit to branch releases/10.0 in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit eaeb5513c52e27c829d698745d316a5644ecf79a Author: Juha Niskanen <[email protected]> AuthorDate: Mon Oct 19 18:43:55 2020 +0300 system/cu: do not reset baud rate to zero when parity options are used cfsetspeed() now stores baud rate to c_cflag member of struct termios, so it must not be overridden later on. Signed-off-by: Juha Niskanen <[email protected]> --- system/cu/cu.h | 2 +- system/cu/cu_main.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/system/cu/cu.h b/system/cu/cu.h index 9ca6c78..f16aec1 100644 --- a/system/cu/cu.h +++ b/system/cu/cu.h @@ -70,7 +70,7 @@ struct cu_globals_s { - int infd; /* Incmoming data from serial port */ + int infd; /* Incoming data from serial port */ int outfd; /* Outgoing data to serial port */ pthread_t listener; /* Terminal listener thread */ }; diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index d914284..621088d 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -82,7 +82,7 @@ enum parity_mode static struct cu_globals_s g_cu; #ifdef CONFIG_SERIAL_TERMIOS -int fd_std_tty; +static int fd_std_tty; static struct termios g_tio_std; static struct termios g_tio_dev; #endif @@ -144,13 +144,6 @@ static int set_termios(int fd, int rate, enum parity_mode parity, tio = g_tio_dev; - /* set baudrate */ - - if (rate != 0) - { - cfsetspeed(&tio, rate); - } - switch (parity) { case PARITY_EVEN: @@ -165,6 +158,13 @@ static int set_termios(int fd, int rate, enum parity_mode parity, break; } + /* set baudrate */ + + if (rate != 0) + { + cfsetspeed(&tio, rate); + } + if (rtscts) { tio.c_cflag |= CRTS_IFLOW | CCTS_OFLOW;
