Skip to content

Blocking UART read or readline without timeout #15380

Discussion options

You must be logged in to vote
uart = machine.UART(0,9600,timeout=int(2**31-1))

>>> int(2**31-1) / 1000 / 86400
24.85514 days

If that's not enough, use a while True: loop and exit when read returns anything else than None.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@alvv-z
Comment options

Answer selected by alvv-z
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants