From b66514686a8745ee36a4384dec044d3ae31d7dcb Mon Sep 17 00:00:00 2001 From: Shell Date: Wed, 28 Jun 2023 09:11:17 +0800 Subject: [components/tty] fix bug on foreground app switch (#7726) --- components/drivers/tty/include/tty.h | 4 ++-- components/drivers/tty/tty.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'components/drivers') diff --git a/components/drivers/tty/include/tty.h b/components/drivers/tty/include/tty.h index 298b033373..1c0fa09ca3 100644 --- a/components/drivers/tty/include/tty.h +++ b/components/drivers/tty/include/tty.h @@ -179,8 +179,8 @@ enum #define TTY_DRIVER_TYPE_SYSTEM 0x0001 #define TTY_DRIVER_TYPE_CONSOLE 0x0002 #define TTY_DRIVER_TYPE_SERIAL 0x0003 -#define TTY_DRIVER_TYPE_PTY 0x0004 -#define TTY_DRIVER_TYPE_SCC 0x0005 /* scc driver */ +#define TTY_DRIVER_TYPE_PTY 0x0004 +#define TTY_DRIVER_TYPE_SCC 0x0005 /* scc driver */ #define TTY_DRIVER_TYPE_SYSCONS 0x0006 /* tty magic number */ diff --git a/components/drivers/tty/tty.c b/components/drivers/tty/tty.c index 10683b5f9d..748be743cb 100644 --- a/components/drivers/tty/tty.c +++ b/components/drivers/tty/tty.c @@ -5,7 +5,8 @@ * * Change Logs: * Date Author Notes - * 2021.12.07 linzhenxing first version + * 2021-12-07 linzhenxing first version + * 2023-06-26 WangXiaoyao fix bug on foreground app switch */ #include #include @@ -41,7 +42,7 @@ const struct termios tty_std_termios = { /* for the benefit of tty drivers */ void tty_initstack(struct tty_node *node) { node->lwp = RT_NULL; - node->next = node; + node->next = RT_NULL; } static struct tty_node tty_node_cache = { RT_NULL, RT_NULL }; -- cgit v1.3.1