summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/esp_mphal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c
index 9f090a0973..7d33f89cbf 100644
--- a/esp8266/esp_mphal.c
+++ b/esp8266/esp_mphal.c
@@ -161,16 +161,16 @@ static int call_dupterm_read(void) {
nlr_buf_t nlr;
if (nlr_push(&nlr) == 0) {
- mp_obj_t read_m[3];
- mp_load_method(MP_STATE_PORT(term_obj), MP_QSTR_read, read_m);
- read_m[2] = MP_OBJ_NEW_SMALL_INT(1);
- mp_obj_t res = mp_call_method_n_kw(1, 0, read_m);
+ mp_obj_t readinto_m[3];
+ mp_load_method(MP_STATE_PORT(term_obj), MP_QSTR_readinto, readinto_m);
+ readinto_m[2] = MP_STATE_PORT(dupterm_arr_obj);
+ mp_obj_t res = mp_call_method_n_kw(1, 0, readinto_m);
if (res == mp_const_none) {
nlr_pop();
return -2;
}
mp_buffer_info_t bufinfo;
- mp_get_buffer_raise(res, &bufinfo, MP_BUFFER_READ);
+ mp_get_buffer_raise(MP_STATE_PORT(dupterm_arr_obj), &bufinfo, MP_BUFFER_READ);
if (bufinfo.len == 0) {
mp_uos_deactivate("dupterm: EOF received, deactivating\n", MP_OBJ_NULL);
nlr_pop();