aboutsummaryrefslogtreecommitdiffstats
path: root/os/various
diff options
context:
space:
mode:
Diffstat (limited to 'os/various')
-rw-r--r--os/various/chprintf.c15
-rw-r--r--os/various/shell.c13
2 files changed, 9 insertions, 19 deletions
diff --git a/os/various/chprintf.c b/os/various/chprintf.c
index 78a4a8ac1..2e03fe9c2 100644
--- a/os/various/chprintf.c
+++ b/os/various/chprintf.c
@@ -37,11 +37,6 @@
#define MAX_FILLER 11
#define FLOAT_PRECISION 100000
-static void _putc(BaseSequentialStream *chp, char c) {
-
- chSequentialStreamWrite(chp, (const uint8_t *)&c, 1);
-}
-
static char *long_to_string_with_divisor(char *p,
long num,
unsigned radix,
@@ -133,7 +128,7 @@ void chprintf(BaseSequentialStream *chp, const char *fmt, ...) {
return;
}
if (c != '%') {
- _putc(chp, (uint8_t)c);
+ chSequentialStreamPut(chp, (uint8_t)c);
continue;
}
p = tmpbuf;
@@ -248,18 +243,18 @@ unsigned_common:
width = -width;
if (width < 0) {
if (*s == '-' && filler == '0') {
- _putc(chp, (uint8_t)*s++);
+ chSequentialStreamPut(chp, (uint8_t)*s++);
i--;
}
do
- _putc(chp, (uint8_t)filler);
+ chSequentialStreamPut(chp, (uint8_t)filler);
while (++width != 0);
}
while (--i >= 0)
- _putc(chp, (uint8_t)*s++);
+ chSequentialStreamPut(chp, (uint8_t)*s++);
while (width) {
- _putc(chp, (uint8_t)filler);
+ chSequentialStreamPut(chp, (uint8_t)filler);
width--;
}
}
diff --git a/os/various/shell.c b/os/various/shell.c
index fd9451f2e..611da6de0 100644
--- a/os/various/shell.c
+++ b/os/various/shell.c
@@ -38,11 +38,6 @@
*/
EventSource shell_terminated;
-static void _putc(BaseSequentialStream *chp, char c) {
-
- chSequentialStreamWrite(chp, (const uint8_t *)&c, 1);
-}
-
static char *_strtok(char *str, const char *delim, char **saveptr) {
char *token;
if (str)
@@ -271,9 +266,9 @@ bool_t shellGetLine(BaseSequentialStream *chp, char *line, unsigned size) {
}
if (c == 8) {
if (p != line) {
- _putc(chp, c);
- _putc(chp, 0x20);
- _putc(chp, c);
+ chSequentialStreamPut(chp, c);
+ chSequentialStreamPut(chp, 0x20);
+ chSequentialStreamPut(chp, c);
p--;
}
continue;
@@ -286,7 +281,7 @@ bool_t shellGetLine(BaseSequentialStream *chp, char *line, unsigned size) {
if (c < 0x20)
continue;
if (p < line + size - 1) {
- _putc(chp, c);
+ chSequentialStreamPut(chp, c);
*p++ = (char)c;
}
}