From 1165e852c1091835d8bc43882a6a1d637209128c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Mon, 12 Nov 2018 18:17:42 +0300 Subject: [PATCH] subsys: console: tty: Use tty_putchar() instead of console_putchar() To be properly layered. This call is used to signal to user an input buffer overload. Take a chance to output just a single character in this case, to avoid amplification and possible output buffer overflow either. Signed-off-by: Paul Sokolovsky --- subsys/console/tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subsys/console/tty.c b/subsys/console/tty.c index c0dbf0644d..257102cf12 100644 --- a/subsys/console/tty.c +++ b/subsys/console/tty.c @@ -12,6 +12,7 @@ #include static int tty_irq_input_hook(struct tty_serial *tty, u8_t c); +static int tty_putchar(struct tty_serial *tty, u8_t c); static void tty_uart_isr(void *user_data) { @@ -57,8 +58,7 @@ static int tty_irq_input_hook(struct tty_serial *tty, u8_t c) if (rx_next == tty->rx_get) { /* Try to give a clue to user that some input was lost */ - console_putchar('~'); - console_putchar('\n'); + tty_putchar(tty, '~'); return 1; }