summaryrefslogtreecommitdiff
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2023-03-09 13:56:23 +1100
committerDamien George <damien@micropython.org>2023-03-10 11:19:15 +1100
commit78dc2db2ba7e14a44f00fc07dd37f3323fcaf251 (patch)
tree3d29da1f8de4f95a8661c444f31d42f7249d9428 /py/mpconfig.h
parentb3c8ab37ec86d19277e9d1dd10b5741ab93022ed (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 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 564580c02..db9c623f4 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -904,6 +904,11 @@ typedef double mp_float_t;
#define MICROPY_USE_INTERNAL_PRINTF (1)
#endif
+// The mp_print_t printer used for printf output when MICROPY_USE_INTERNAL_PRINTF is enabled
+#ifndef MICROPY_INTERNAL_PRINTF_PRINTER
+#define MICROPY_INTERNAL_PRINTF_PRINTER (&mp_plat_print)
+#endif
+
// Support for internal scheduler
#ifndef MICROPY_ENABLE_SCHEDULER
#define MICROPY_ENABLE_SCHEDULER (MICROPY_CONFIG_ROM_LEVEL_AT_LEAST_EXTRA_FEATURES)