serial: Make SIGINT and SIGTSTP work even without CONFIG_SERIAL_TERMIOS
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
901361be48
commit
a010cb1af1
@ -191,7 +191,6 @@ config TTY_FORCE_PANIC_CHAR
|
||||
config TTY_SIGINT
|
||||
bool "Support SIGINT"
|
||||
default n
|
||||
depends on SERIAL_TERMIOS
|
||||
---help---
|
||||
Whether support Ctrl-c/x event. Enabled automatically for console
|
||||
devices. May be enabled for other serial devices using the ISIG bit
|
||||
@ -235,7 +234,6 @@ config TTY_SIGINT_CHAR
|
||||
config TTY_SIGTSTP
|
||||
bool "Support SIGTSTP"
|
||||
default n
|
||||
depends on SERIAL_TERMIOS
|
||||
---help---
|
||||
Whether support Ctrl-z event. Enabled automatically for console
|
||||
devices. May be enabled for other serial devices using the ISIG bit
|
||||
|
@ -1603,13 +1603,13 @@ errout:
|
||||
|
||||
int uart_register(FAR const char *path, FAR uart_dev_t *dev)
|
||||
{
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
# if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)
|
||||
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)
|
||||
/* Initialize of the task that will receive SIGINT signals. */
|
||||
|
||||
dev->pid = (pid_t)-1;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
/* If this UART is a serial console */
|
||||
|
||||
if (dev->isconsole)
|
||||
|
@ -280,15 +280,16 @@ struct uart_dev_s
|
||||
#endif
|
||||
bool isconsole; /* true: This is the serial console */
|
||||
|
||||
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)
|
||||
pid_t pid; /* Thread PID to receive signals (-1 if none) */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
/* Terminal control flags */
|
||||
|
||||
tcflag_t tc_iflag; /* Input modes */
|
||||
tcflag_t tc_oflag; /* Output modes */
|
||||
tcflag_t tc_lflag; /* Local modes */
|
||||
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)
|
||||
pid_t pid; /* Thread PID to receive signals (-1 if none) */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Semaphores */
|
||||
|
Loading…
Reference in New Issue
Block a user