cc3200: uart.read() returns EGAIN if no chars available.
This commit is contained in:
parent
9a507c67ad
commit
7ff585333e
|
@ -599,9 +599,9 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i
|
||||||
|
|
||||||
// wait for first char to become available
|
// wait for first char to become available
|
||||||
if (!uart_rx_wait(self)) {
|
if (!uart_rx_wait(self)) {
|
||||||
// we can either return 0 to indicate EOF (then read() method returns b'')
|
// return EAGAIN error to indicate non-blocking (then read() method returns None)
|
||||||
// or return EAGAIN error to indicate non-blocking (then read() method returns None)
|
*errcode = EAGAIN;
|
||||||
return 0;
|
return MP_STREAM_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// read the data
|
// read the data
|
||||||
|
|
Loading…
Reference in New Issue