From 06d4a1c42edadccd03295f7824817fffa535cf80 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Sun, 3 Jun 2012 15:08:34 +0100 Subject: [PATCH] uart_pty: Add CR/LF conversion to the tap Make sure whst we type is converted too Signed-off-by: Michel Pollet --- examples/parts/uart_pty.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/parts/uart_pty.c b/examples/parts/uart_pty.c index eb3ba7f..ff95942 100644 --- a/examples/parts/uart_pty.c +++ b/examples/parts/uart_pty.c @@ -84,6 +84,12 @@ uart_pty_flush_incoming( if (p->tap.s) { while (p->xon && !uart_pty_fifo_isempty(&p->tap.out)) { uint8_t byte = uart_pty_fifo_read(&p->tap.out); + if (p->tap.crlf && byte == '\r') { + uart_pty_fifo_write(&p->tap.in, '\n'); + } + if (byte == '\n') + continue; + uart_pty_fifo_write(&p->tap.in, byte); avr_raise_irq(p->irq + IRQ_UART_PTY_BYTE_OUT, byte); } } -- 2.39.5