cc3200: uart.read() returns EGAIN if no chars available.

This commit is contained in:
danicampora 2015-10-20 09:27:21 +02:00
parent 9a507c67ad
commit 7ff585333e
1 changed files with 3 additions and 3 deletions

View File

@ -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