diff --git a/system/cu/cu.h b/system/cu/cu.h index 9ca6c78bb..f16aec189 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 d914284b3..621088d3d 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;