Skip to content

Correct UART reads to return error on timeout.#928

Merged
dhalbert merged 1 commit intoadafruit:masterfrom
tannewt:fix_uart_timeout
Jun 12, 2018
Merged

Correct UART reads to return error on timeout.#928
dhalbert merged 1 commit intoadafruit:masterfrom
tannewt:fix_uart_timeout

Conversation

@tannewt
Copy link
Member

@tannewt tannewt commented Jun 12, 2018

This causes read to correctly return None instead of b''.

Fixes #874

This causes read to correctly return None instead of b''.

Fixes micropython#874
@tannewt tannewt added this to the 3.0 milestone Jun 12, 2018
@tannewt tannewt requested a review from dhalbert June 12, 2018 21:07
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay! Tested on M0:

>>> import board, busio
>>> u = busio.UART(board.TX, board.RX)
>>> print(u.read(3))
None
>>> print(u.read(0))
b''

@dhalbert dhalbert merged commit 144c059 into adafruit:master Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants