mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-16 01:05:15 +08:00
[components][lwp] fix TTY init format and control character copy
- place the TIOCLINUX case brace on its own line - use sizeof(tty_ctrl_charset) directly as the memcpy size - fix the cppcheck sizeofDivisionMemfunc warning
This commit is contained in:
1 parent
24c624aa7a
commit
b4c6828cf4
2 files changed
+3
-3
No files matched your search
@@ -547,7 +547,8 @@ int lwp_tty_ioctl_adapter(lwp_tty_t tp, int cmd, int oflags, void *args, rt_thre
|
||||
error = (IOCTL(FIONREAD, args, fflags, td));
|
||||
break;
|
||||
|
||||
case TIOCLINUX: {
|
||||
case TIOCLINUX:
|
||||
{
|
||||
/*
|
||||
* Linux uses TIOCLINUX to obtain console keyboard modifier
|
||||
* state. RT-Thread serial consoles do not expose that state,
|
||||
|
||||
@@ -351,8 +351,7 @@ static void tty_init_termios(lwp_tty_t tp)
|
||||
tp->t_winsize.ws_row = 24;
|
||||
tp->t_winsize.ws_col = 80;
|
||||
|
||||
memcpy(&t->c_cc, tty_ctrl_charset,
|
||||
sizeof(tty_ctrl_charset) / sizeof(tty_ctrl_charset[0]));
|
||||
memcpy(&t->c_cc, tty_ctrl_charset, sizeof(tty_ctrl_charset));
|
||||
|
||||
#ifdef USING_BSD_INIT_LOCK_DEVICE
|
||||
tp->t_termios_init_out = *t;
|
||||
|
||||
Reference in new issue
Block a user