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 <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
ed852e8b4a
commit
1165e852c1
|
@ -12,6 +12,7 @@
|
||||||
#include <drivers/console/uart_console.h>
|
#include <drivers/console/uart_console.h>
|
||||||
|
|
||||||
static int tty_irq_input_hook(struct tty_serial *tty, u8_t c);
|
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)
|
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) {
|
if (rx_next == tty->rx_get) {
|
||||||
/* Try to give a clue to user that some input was lost */
|
/* Try to give a clue to user that some input was lost */
|
||||||
console_putchar('~');
|
tty_putchar(tty, '~');
|
||||||
console_putchar('\n');
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue