diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-08 10:38:46 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-12 09:57:53 +0200 |
commit | 1bc0ad2e12e9e523a9b9043ac47254a0597826bf (patch) | |
tree | 3ce927bb1e48b6961d64f235162fa823cbac815d /cpukit | |
parent | posix: Use mutex object itself for condvar (diff) | |
download | rtems-1bc0ad2e12e9e523a9b9043ac47254a0597826bf.tar.bz2 |
Simplify and unify BSP_output_char
The BSP_output_char should output a char and not mingle with high level
processing, e.g. '\n' to '\r\n' translation. Move this translation to
rtems_putc(). Remove it from all the BSP_output_char implementations.
Close #3122.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/include/rtems/bspIo.h | 9 | ||||
-rw-r--r-- | cpukit/libcsupport/src/putk.c | 4 | ||||
-rw-r--r-- | cpukit/libmisc/serdbg/termios_printk.c | 3 |
3 files changed, 9 insertions, 7 deletions
diff --git a/cpukit/include/rtems/bspIo.h b/cpukit/include/rtems/bspIo.h index d0d8f83dcd..8ab46afecd 100644 --- a/cpukit/include/rtems/bspIo.h +++ b/cpukit/include/rtems/bspIo.h @@ -55,6 +55,9 @@ typedef int (*BSP_polling_getchar_function_type) (void); /** * This variable points to the BSP provided method to output a * character for the purposes of debug output. + * + * It must output only the specific character. It must not perform character + * translations, e.g. "\n" to "\r\n". */ extern BSP_output_char_function_type BSP_output_char; @@ -94,7 +97,8 @@ extern int vprintk(const char *fmt, va_list ap); /** * @brief Kernel Print * - * This method allows the user to perform a debug printk(). + * This method allows the user to perform a debug printk(). It performs a + * character translation from "\n" to "\r\n". * * @param[in] fmt is a printf()-style format string * @@ -116,7 +120,8 @@ extern int putk(const char *s); /** * @brief Kernel Put Character * - * This method allows the user to perform a debug putc(). + * This method allows the user to perform a debug putc(). It performs a + * character translation from "\n" to "\r\n". * * @param[in] c is the character to print */ diff --git a/cpukit/libcsupport/src/putk.c b/cpukit/libcsupport/src/putk.c index 76fa8b0040..5a84a4be0b 100644 --- a/cpukit/libcsupport/src/putk.c +++ b/cpukit/libcsupport/src/putk.c @@ -29,7 +29,7 @@ int putk(const char *s) int len_out = 0; for (p=s ; *p ; p++, len_out++ ) - BSP_output_char(*p); - BSP_output_char('\n'); + rtems_putc(*p); + rtems_putc('\n'); return len_out + 1; } diff --git a/cpukit/libmisc/serdbg/termios_printk.c b/cpukit/libmisc/serdbg/termios_printk.c index 01ed334563..510753dea7 100644 --- a/cpukit/libmisc/serdbg/termios_printk.c +++ b/cpukit/libmisc/serdbg/termios_printk.c @@ -85,9 +85,6 @@ void termios_printk_outputchar /* * send character to debug serial port */ - if (c == '\n') { - termios_printk_tty->device.write(termios_printk_tty->minor,&cr,1); - } termios_printk_tty->device.write(termios_printk_tty->minor,&c,1); } } |