summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/modesp.c3
-rw-r--r--esp8266/modpybpin.c4
-rw-r--r--esp8266/mpconfigport.h3
3 files changed, 6 insertions, 4 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index 29ef42ab2a..3b5a0b7d74 100644
--- a/esp8266/modesp.c
+++ b/esp8266/modesp.c
@@ -32,7 +32,6 @@
#include "py/obj.h"
#include "py/gc.h"
#include "py/runtime.h"
-#include "py/pfenv.h"
#include MICROPY_HAL_H
#include "queue.h"
#include "user_interface.h"
@@ -52,7 +51,7 @@ mp_obj_t call_function_1_protected(mp_obj_t fun, mp_obj_t arg) {
if (nlr_push(&nlr) == 0) {
return mp_call_function_1(fun, arg);
} else {
- mp_obj_print_exception(printf_wrapper, NULL, (mp_obj_t)nlr.ret_val);
+ mp_obj_print_exception(&mp_plat_print, (mp_obj_t)nlr.ret_val);
return (mp_obj_t)nlr.ret_val;
}
}
diff --git a/esp8266/modpybpin.c b/esp8266/modpybpin.c
index 0089e71ab2..8b09c7f655 100644
--- a/esp8266/modpybpin.c
+++ b/esp8266/modpybpin.c
@@ -65,11 +65,11 @@ STATIC const pyb_pin_obj_t pyb_pin_obj[] = {
{{&pyb_pin_type}, 15, 15, PERIPHS_IO_MUX_MTDO_U, FUNC_GPIO15},
};
-STATIC void pyb_pin_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t self_in, mp_print_kind_t kind) {
+STATIC void pyb_pin_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_t kind) {
pyb_pin_obj_t *self = self_in;
// pin name
- print(env, "Pin(%u)", self->pin_id);
+ mp_printf(print, "Pin(%u)", self->pin_id);
}
// pin.init(mode, pull=Pin.PULL_NONE, af=-1)
diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h
index 7e7f0fdbac..dcd9407f82 100644
--- a/esp8266/mpconfigport.h
+++ b/esp8266/mpconfigport.h
@@ -52,6 +52,9 @@ typedef void *machine_ptr_t; // must be of pointer size
typedef const void *machine_const_ptr_t; // must be of pointer size
typedef long mp_off_t;
+void mp_hal_stdout_tx_strn_cooked(const char *str, mp_uint_t len);
+#define MP_PLAT_PRINT_STRN(str, len) mp_hal_stdout_tx_strn_cooked(str, len)
+
// extra built in names to add to the global namespace
extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj;
#define MICROPY_PORT_BUILTINS \