diff --git a/py/obj.c b/py/obj.c index dad27b8772..c376adc03c 100644 --- a/py/obj.c +++ b/py/obj.c @@ -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