Merge pull request #928 from tannewt/fix_uart_timeout

Correct UART reads to return error on timeout.
This commit is contained in:
Dan Halbert 2018-06-12 18:41:18 -04:00 committed by GitHub
commit 144c0597e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

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