From da2d2b6d884201f2cbb23f74c6c5557e30fb1f14 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 2 Aug 2018 14:04:44 +1000 Subject: py/mpconfig.h: Introduce MICROPY_DEBUG_PRINTER for debugging output. This patch in effect renames MICROPY_DEBUG_PRINTER_DEST to MICROPY_DEBUG_PRINTER, moving its default definition from lib/utils/printf.c to py/mpconfig.h to make it official and documented, and makes this macro a pointer rather than the actual mp_print_t struct. This is done to get consistency with MICROPY_ERROR_PRINTER, and provide this macro for use outside just lib/utils/printf.c. Ports are updated to use the new macro name. --- lib/utils/printf.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/utils/printf.c') diff --git a/lib/utils/printf.c b/lib/utils/printf.c index 117efff42..1ceeea39f 100644 --- a/lib/utils/printf.c +++ b/lib/utils/printf.c @@ -41,11 +41,7 @@ int DEBUG_printf(const char *fmt, ...) { va_list ap; va_start(ap, fmt); - #ifndef MICROPY_DEBUG_PRINTER_DEST - #define MICROPY_DEBUG_PRINTER_DEST mp_plat_print - #endif - extern const mp_print_t MICROPY_DEBUG_PRINTER_DEST; - int ret = mp_vprintf(&MICROPY_DEBUG_PRINTER_DEST, fmt, ap); + int ret = mp_vprintf(MICROPY_DEBUG_PRINTER, fmt, ap); va_end(ap); return ret; } -- cgit v1.2.3