From c41b47e3e4a0fe5ec744a78d8d8ed770292e0b63 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 23 Feb 2017 15:19:47 +0100 Subject: termios: Introduce doTransmit() --- cpukit/libcsupport/src/termios.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'cpukit/libcsupport') diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c index e5bfeaa236..376f176623 100644 --- a/cpukit/libcsupport/src/termios.c +++ b/cpukit/libcsupport/src/termios.c @@ -1020,11 +1020,9 @@ startXmit ( /* * Send characters to device-specific code */ -void -rtems_termios_puts ( - const void *_buf, size_t len, struct rtems_termios_tty *tty) +static void +doTransmit (const char *buf, size_t len, rtems_termios_tty *tty) { - const char *buf = _buf; unsigned int newHead; rtems_termios_device_context *ctx = tty->device_context; rtems_interrupt_lock_context lock_context; @@ -1092,6 +1090,13 @@ rtems_termios_puts ( } } +void +rtems_termios_puts ( + const void *_buf, size_t len, struct rtems_termios_tty *tty) +{ + doTransmit (_buf, len, tty); +} + /* * Handle output processing */ @@ -1163,7 +1168,7 @@ oproc (unsigned char c, struct rtems_termios_tty *tty) tty->column = oldColumn + columnAdj; } - rtems_termios_puts (buf, len, tty); + doTransmit (buf, len, tty); } static uint32_t @@ -1179,7 +1184,7 @@ rtems_termios_write_tty (struct rtems_termios_tty *tty, const char *buffer, while (count--) oproc (*buffer++, tty); } else { - rtems_termios_puts (buffer, initial_count, tty); + doTransmit (buffer, initial_count, tty); } return initial_count; @@ -1217,7 +1222,7 @@ echo (unsigned char c, struct rtems_termios_tty *tty) echobuf[0] = '^'; echobuf[1] = c ^ 0x40; - rtems_termios_puts (echobuf, 2, tty); + doTransmit (echobuf, 2, tty); tty->column += 2; } else { oproc (c, tty); @@ -1277,18 +1282,18 @@ erase (struct rtems_termios_tty *tty, int lineFlag) * Back up over the tab */ while (tty->column > col) { - rtems_termios_puts ("\b", 1, tty); + doTransmit ("\b", 1, tty); tty->column--; } } else { if (iscntrl (c) && (tty->termios.c_lflag & ECHOCTL)) { - rtems_termios_puts ("\b \b", 3, tty); + doTransmit ("\b \b", 3, tty); if (tty->column) tty->column--; } if (!iscntrl (c) || (tty->termios.c_lflag & ECHOCTL)) { - rtems_termios_puts ("\b \b", 3, tty); + doTransmit ("\b \b", 3, tty); if (tty->column) tty->column--; } -- cgit v1.2.3