[PATCH 7/8] termios: Introduce doTransmit()
Sebastian Huber
sebastian.huber at embedded-brains.de
Thu Feb 23 14:45:39 UTC 2017
---
cpukit/libcsupport/src/termios.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/cpukit/libcsupport/src/termios.c b/cpukit/libcsupport/src/termios.c
index 4fd98a5..d185398 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
*/
@@ -1165,7 +1170,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
@@ -1181,7 +1186,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;
@@ -1219,7 +1224,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);
@@ -1279,18 +1284,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--;
}
--
1.8.4.5
More information about the devel
mailing list