Merge pull request #928 from tannewt/fix_uart_timeout
Correct UART reads to return error on timeout.
This commit is contained in:
commit
144c0597e9
|
@ -269,6 +269,11 @@ size_t common_hal_busio_uart_read(busio_uart_obj_t *self, uint8_t *data, size_t
|
|||
#endif
|
||||
}
|
||||
|
||||
if (total_read == 0) {
|
||||
*errcode = EAGAIN;
|
||||
return MP_STREAM_ERROR;
|
||||
}
|
||||
|
||||
return total_read;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue