summaryrefslogtreecommitdiffstatshomepage
path: root/stm/printf.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-16 18:11:42 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-02-16 18:20:49 +0200
commit44739e280e81c2ebf2491818eb5a6d0ef30c7c6b (patch)
treeb3dd81094d08289663452e9c9b744b37750e3869 /stm/printf.c
parent1b694c082eeda7b147ac7873964a3dd7bb9583a3 (diff)
downloadmicropython-44739e280e81c2ebf2491818eb5a6d0ef30c7c6b.tar.gz
micropython-44739e280e81c2ebf2491818eb5a6d0ef30c7c6b.zip
Make DEBUG_printf() a proper function, implementation is port-dependent.
In particular, unix outputs to stderr, to allow to run testsuite against micropython built with debug output (by redirecting stderr to /dev/null).
Diffstat (limited to 'stm/printf.c')
-rw-r--r--stm/printf.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/stm/printf.c b/stm/printf.c
index a0620018cc..7bac07ab72 100644
--- a/stm/printf.c
+++ b/stm/printf.c
@@ -267,6 +267,17 @@ int vprintf(const char *fmt, va_list ap) {
return pfenv_printf(&pfenv_stdout, fmt, ap);
}
+#if MICROPY_DEBUG_PRINTERS
+int DEBUG_printf(const char *fmt, ...) {
+ (void)stream;
+ va_list ap;
+ va_start(ap, fmt);
+ int ret = pfenv_printf(&pfenv_stdout, fmt, ap);
+ va_end(ap);
+ return ret;
+}
+#endif
+
// need this because gcc optimises printf("%c", c) -> putchar(c), and printf("a") -> putchar('a')
int putchar(int c) {
char chr = c;