serial: more baudrate 1800/1200/600

This commit is contained in:
fengzero
2023-04-06 08:14:38 +00:00
parent 70823b6dc3
commit 5da1c27c8c
2 changed files with 15 additions and 0 deletions
@@ -40,6 +40,9 @@ typedef enum neu_conn_tty_baud {
NEU_CONN_TTY_BAUD_9600,
NEU_CONN_TTY_BAUD_4800,
NEU_CONN_TTY_BAUD_2400,
NEU_CONN_TTY_BAUD_1800,
NEU_CONN_TTY_BAUD_1200,
NEU_CONN_TTY_BAUD_600,
} neu_conn_tty_baud_e;
typedef enum neu_conn_tty_parity {
+12
View File
@@ -728,6 +728,18 @@ static void conn_connect(neu_conn_t *conn)
cfsetospeed(&tty_opt, B2400);
cfsetispeed(&tty_opt, B2400);
break;
case NEU_CONN_TTY_BAUD_1800:
cfsetospeed(&tty_opt, B1800);
cfsetispeed(&tty_opt, B1800);
break;
case NEU_CONN_TTY_BAUD_1200:
cfsetospeed(&tty_opt, B1200);
cfsetispeed(&tty_opt, B1200);
break;
case NEU_CONN_TTY_BAUD_600:
cfsetospeed(&tty_opt, B600);
cfsetispeed(&tty_opt, B600);
break;
}
switch (conn->param.params.tty_client.parity) {