diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/sprintf.c | 2 | ||||
-rw-r--r-- | firmware/include/sprintf.h | 5 | ||||
-rw-r--r-- | firmware/logf.c | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/firmware/common/sprintf.c b/firmware/common/sprintf.c index 6c1855e06b..35f977a0a3 100644 --- a/firmware/common/sprintf.c +++ b/firmware/common/sprintf.c | |||
@@ -292,7 +292,7 @@ int fdprintf(int fd, const char *fmt, ...) | |||
292 | return fpr.bytes; /* return 0 on error */ | 292 | return fpr.bytes; /* return 0 on error */ |
293 | } | 293 | } |
294 | 294 | ||
295 | int vfnprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap) | 295 | int vuprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap) |
296 | { | 296 | { |
297 | return format(push, userp, fmt, ap); | 297 | return format(push, userp, fmt, ap); |
298 | } | 298 | } |
diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h index b07ac9dfb6..869b73eb13 100644 --- a/firmware/include/sprintf.h +++ b/firmware/include/sprintf.h | |||
@@ -32,6 +32,9 @@ int snprintf (char *buf, size_t size, const char *fmt, ...) | |||
32 | int vsnprintf (char *buf, int size, const char *fmt, va_list ap); | 32 | int vsnprintf (char *buf, int size, const char *fmt, va_list ap); |
33 | int fdprintf (int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); | 33 | int fdprintf (int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3); |
34 | 34 | ||
35 | int vfnprintf(int (*push)(void *userp, unsigned char data), void *userp, const char *fmt, va_list ap); | 35 | /* callback function is called for every output character (byte) with userp and |
36 | * should return 0 when ch is a char other than '\0' that should stop printing */ | ||
37 | int vuprintf(int (*push)(void *userp, unsigned char data), | ||
38 | void *userp, const char *fmt, va_list ap); | ||
36 | 39 | ||
37 | #endif /* __SPRINTF_H__ */ | 40 | #endif /* __SPRINTF_H__ */ |
diff --git a/firmware/logf.c b/firmware/logf.c index 76b017c092..7d4ffe24af 100644 --- a/firmware/logf.c +++ b/firmware/logf.c | |||
@@ -214,7 +214,7 @@ void _logf(const char *fmt, ...) | |||
214 | DEBUGF("%s\n", buf); | 214 | DEBUGF("%s\n", buf); |
215 | #endif | 215 | #endif |
216 | 216 | ||
217 | vfnprintf(logf_push, NULL, fmt, ap); | 217 | vuprintf(logf_push, NULL, fmt, ap); |
218 | va_end(ap); | 218 | va_end(ap); |
219 | 219 | ||
220 | /* add trailing zero */ | 220 | /* add trailing zero */ |