diff options
author | Damien George <damien@micropython.org> | 2023-03-09 13:56:23 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-03-10 11:19:15 +1100 |
commit | 78dc2db2ba7e14a44f00fc07dd37f3323fcaf251 (patch) | |
tree | 3d29da1f8de4f95a8661c444f31d42f7249d9428 /shared/libc | |
parent | b3c8ab37ec86d19277e9d1dd10b5741ab93022ed (diff) |
py/mpconfig: Provide config option for internal printf printer.
The C-level printf is usually used for internal debugging prints, and a
port/board may want to redirect this somewhere other than stdout.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'shared/libc')
-rw-r--r-- | shared/libc/printf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/libc/printf.c b/shared/libc/printf.c index e8db2b999..6b5373188 100644 --- a/shared/libc/printf.c +++ b/shared/libc/printf.c @@ -60,13 +60,13 @@ int snprintf(char *str, size_t size, const char *fmt, ...); int printf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - int ret = mp_vprintf(&mp_plat_print, fmt, ap); + int ret = mp_vprintf(MICROPY_INTERNAL_PRINTF_PRINTER, fmt, ap); va_end(ap); return ret; } int vprintf(const char *fmt, va_list ap) { - return mp_vprintf(&mp_plat_print, fmt, ap); + return mp_vprintf(MICROPY_INTERNAL_PRINTF_PRINTER, fmt, ap); } // need this because gcc optimises printf("%c", c) -> putchar(c), and printf("a") -> putchar('a') |