summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-23 15:19:47 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-02-28 09:05:47 +0100
commitc41b47e3e4a0fe5ec744a78d8d8ed770292e0b63 (patch)
treeef4ce774c40a005c1fbdecde2bce6b587ec95b38 /cpukit/libcsupport
parenttermios: Simplify oproc() (diff)
downloadrtems-c41b47e3e4a0fe5ec744a78d8d8ed770292e0b63.tar.bz2
termios: Introduce doTransmit()
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r--cpukit/libcsupport/src/termios.c25
1 files changed, 15 insertions, 10 deletions
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--;
}