diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-07-05 14:18:12 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-07-05 14:18:12 +0300 |
commit | 380561836d8d752d55765578506450d7121355b5 (patch) | |
tree | f94e239d036b5dc8d80137f7e137826b1121fd3f /esp8266 | |
parent | a22b6ebff1cee6e2d623a85d9aa8f93dff1512b4 (diff) |
esp8266/esp_mphal: Properly handle dupterm EOF after switching to readinto().
Diffstat (limited to 'esp8266')
-rw-r--r-- | esp8266/esp_mphal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/esp8266/esp_mphal.c b/esp8266/esp_mphal.c index 7d33f89cb..3cc461082 100644 --- a/esp8266/esp_mphal.c +++ b/esp8266/esp_mphal.c @@ -169,13 +169,13 @@ static int call_dupterm_read(void) { nlr_pop(); return -2; } - mp_buffer_info_t bufinfo; - mp_get_buffer_raise(MP_STATE_PORT(dupterm_arr_obj), &bufinfo, MP_BUFFER_READ); - if (bufinfo.len == 0) { + if (res == MP_OBJ_NEW_SMALL_INT(0)) { mp_uos_deactivate("dupterm: EOF received, deactivating\n", MP_OBJ_NULL); nlr_pop(); return -1; } + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(MP_STATE_PORT(dupterm_arr_obj), &bufinfo, MP_BUFFER_READ); nlr_pop(); if (*(byte*)bufinfo.buf == interrupt_char) { mp_keyboard_interrupt(); |