-
Notifications
You must be signed in to change notification settings - Fork 918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
machine.UART refactor #3832
machine.UART refactor #3832
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
This may break some application that assumed the previous incorrect behavior, but it is certainly an improvement over what we had previously.
We might want to do something similar for ReadByte
: at the moment it does not block while the vast majority of applications need a blocking interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
One of the jobs failed- maybe a flaky build? @deadprogram @aykevl |
OK, the flaky test passed. Merging now. Thank you everyone for the great feedback! |
* add gosched calls to UART * add UART.flush() stubs for all supported architectures * add comment un uart.go on flush functionality * uart.writeByte as base of UART usage * fix NXP having duplicate WriteByte * fix writeByte not returning error on some platforms * add flush method for fe310 device * check for error in WriteByte call to writeByte
* add gosched calls to UART * add UART.flush() stubs for all supported architectures * add comment un uart.go on flush functionality * uart.writeByte as base of UART usage * fix NXP having duplicate WriteByte * fix writeByte not returning error on some platforms * add flush method for fe310 device * check for error in WriteByte call to writeByte
Resolves #3537, closes #3538.
Adds:
UART.flush
: method implemented by UARTs that blocks until all data has finished being transmitteduart.writeByte
: method implemented by UARTs that writes over the UART pin without blocking.Semantic changes:
UART.WriteByte
andUART.Write
: Methods now expected to block until all data has been finished being transmitted over wire.