Skip to content

Commit 7ff5853

Browse files
author
danicampora
committed
cc3200: uart.read() returns EGAIN if no chars available.
1 parent 9a507c6 commit 7ff5853

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cc3200/mods/pybuart.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,9 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i
599599

600600
// wait for first char to become available
601601
if (!uart_rx_wait(self)) {
602-
// we can either return 0 to indicate EOF (then read() method returns b'')
603-
// or return EAGAIN error to indicate non-blocking (then read() method returns None)
604-
return 0;
602+
// return EAGAIN error to indicate non-blocking (then read() method returns None)
603+
*errcode = EAGAIN;
604+
return MP_STREAM_ERROR;
605605
}
606606

607607
// read the data

0 commit comments

Comments
 (0)