mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
serial: add CONFIG_TTY_LAUNCH support
this allow user start new program from tty Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) || \
|
||||
defined(CONFIG_TTY_FORCE_PANIC)
|
||||
defined(CONFIG_TTY_FORCE_PANIC) || defined(CONFIG_TTY_LAUNCH)
|
||||
static int uart_check_signo(int pid, const char *buf, size_t size)
|
||||
{
|
||||
size_t i;
|
||||
@@ -72,6 +72,14 @@ static int uart_check_signo(int pid, const char *buf, size_t size)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TTY_LAUNCH
|
||||
if (buf[i] == CONFIG_TTY_LAUNCH_CHAR)
|
||||
{
|
||||
uart_launch();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TTY_SIGINT
|
||||
if (pid > 0 && buf[i] == CONFIG_TTY_SIGINT_CHAR)
|
||||
{
|
||||
@@ -105,7 +113,7 @@ static int uart_check_signo(int pid, const char *buf, size_t size)
|
||||
|
||||
#if defined(CONFIG_SERIAL_RXDMA) && \
|
||||
(defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) || \
|
||||
defined(CONFIG_TTY_FORCE_PANIC))
|
||||
defined(CONFIG_TTY_FORCE_PANIC) || defined(CONFIG_TTY_LAUNCH))
|
||||
static int uart_recvchars_signo(FAR uart_dev_t *dev)
|
||||
{
|
||||
FAR struct uart_dmaxfer_s *xfer = &dev->dmarx;
|
||||
@@ -369,7 +377,7 @@ void uart_recvchars_done(FAR uart_dev_t *dev)
|
||||
FAR struct uart_buffer_s *rxbuf = &dev->recv;
|
||||
size_t nbytes = xfer->nbytes;
|
||||
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) || \
|
||||
defined(CONFIG_TTY_FORCE_PANIC)
|
||||
defined(CONFIG_TTY_FORCE_PANIC) || defined(CONFIG_TTY_LAUNCH)
|
||||
int signo = 0;
|
||||
|
||||
/* Check if the SIGINT character is anywhere in the newly received DMA
|
||||
|
||||
Reference in New Issue
Block a user