diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-02-17 00:32:18 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-02-17 00:32:18 +0200 |
commit | 8c705233f3bb335a5531cc397b794a7537b9daf7 (patch) | |
tree | 6b892d9e9cceaae56363306bc3c7817befcab9ca /py | |
parent | 1f91e92cc6774b79ea59643bb4ab27c1d33bda3a (diff) | |
download | micropython-8c705233f3bb335a5531cc397b794a7537b9daf7.tar.gz micropython-8c705233f3bb335a5531cc397b794a7537b9daf7.zip |
py: Fix mp_obj_print() to work when Python streams are not used.
Diffstat (limited to 'py')
-rw-r--r-- | py/obj.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -72,14 +72,16 @@ void mp_obj_print_helper(void (*print)(void *env, const char *fmt, ...), void *e } void mp_obj_print(mp_obj_t o_in, mp_print_kind_t kind) { +#if MICROPY_PY_IO // defined per port; type of these is irrelevant, just need pointer extern mp_uint_t mp_sys_stdout_obj; - pfenv_t pfenv; pfenv.data = &mp_sys_stdout_obj; pfenv.print_strn = (void (*)(void *, const char *, mp_uint_t))mp_stream_write; - mp_obj_print_helper((void (*)(void *env, const char *fmt, ...))pfenv_printf, &pfenv, o_in, kind); +#else + mp_obj_print_helper(printf_wrapper, NULL, o_in, kind); +#endif } // helper function to print an exception with traceback |