diff options
author | Damien George <damien.p.george@gmail.com> | 2015-04-11 12:01:39 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2015-04-16 14:30:16 +0000 |
commit | 5ae5ec986ea5e14321f6c8091454c165c23b40c5 (patch) | |
tree | 65c080e594f9268fc6d0efea7afed956e14dded8 /py/mpprint.h | |
parent | 7f9d1d6ab923096582622b700bedb6a571518eac (diff) | |
download | micropython-5ae5ec986ea5e14321f6c8091454c165c23b40c5.tar.gz micropython-5ae5ec986ea5e14321f6c8091454c165c23b40c5.zip |
py: Make mp_sys_stdout_print object, wrapping sys.stdout for mp_print*.
So now all printing should go via either mp_plat_print or
mp_sys_stdout_print.
Diffstat (limited to 'py/mpprint.h')
-rw-r--r-- | py/mpprint.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/py/mpprint.h b/py/mpprint.h index 60fa18acf9..de497ce90f 100644 --- a/py/mpprint.h +++ b/py/mpprint.h @@ -47,10 +47,13 @@ typedef struct _mp_print_t { mp_print_strn_t print_strn; } mp_print_t; -// Wrapper for platform print function, which wraps MP_PLAT_PRINT_STRN. -// All (non-debug) prints go through this interface (except some which -// go through mp_sys_stdout_obj if MICROPY_PY_IO is defined). +// All (non-debug) prints go through one of the two interfaces below. +// 1) Wrapper for platform print function, which wraps MP_PLAT_PRINT_STRN. extern const mp_print_t mp_plat_print; +#if MICROPY_PY_IO +// 2) Wrapper for printing to sys.stdout. +extern const mp_print_t mp_sys_stdout_print; +#endif int mp_print_str(const mp_print_t *print, const char *str); int mp_print_strn(const mp_print_t *print, const char *str, mp_uint_t len, int flags, char fill, int width); |