diff options
| author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-06-18 16:22:34 +0000 |
|---|---|---|
| committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-06-18 16:22:34 +0000 |
| commit | 9057c6c72be213bb7f07929e2ddd1ab1e942a1de (patch) | |
| tree | 2e61c984622621c39207b1d63198ca50a2e99f6c /os/various | |
| parent | 3626647d7b924ca07df4197f9cde4a7965b8cbdf (diff) | |
| download | ChibiOS-9057c6c72be213bb7f07929e2ddd1ab1e942a1de.tar.gz ChibiOS-9057c6c72be213bb7f07929e2ddd1ab1e942a1de.tar.bz2 ChibiOS-9057c6c72be213bb7f07929e2ddd1ab1e942a1de.zip | |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4294 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/various')
| -rw-r--r-- | os/various/chprintf.c | 15 | ||||
| -rw-r--r-- | os/various/shell.c | 13 |
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;
}
}
|
