Skip to content
This repository was archived by the owner on Oct 28, 2023. It is now read-only.

Commit 3805618

Browse files
committed
esp8266/esp_mphal: Properly handle dupterm EOF after switching to readinto().
1 parent a22b6eb commit 3805618

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

esp8266/esp_mphal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ static int call_dupterm_read(void) {
169169
nlr_pop();
170170
return -2;
171171
}
172-
mp_buffer_info_t bufinfo;
173-
mp_get_buffer_raise(MP_STATE_PORT(dupterm_arr_obj), &bufinfo, MP_BUFFER_READ);
174-
if (bufinfo.len == 0) {
172+
if (res == MP_OBJ_NEW_SMALL_INT(0)) {
175173
mp_uos_deactivate("dupterm: EOF received, deactivating\n", MP_OBJ_NULL);
176174
nlr_pop();
177175
return -1;
178176
}
177+
mp_buffer_info_t bufinfo;
178+
mp_get_buffer_raise(MP_STATE_PORT(dupterm_arr_obj), &bufinfo, MP_BUFFER_READ);
179179
nlr_pop();
180180
if (*(byte*)bufinfo.buf == interrupt_char) {
181181
mp_keyboard_interrupt();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy