embedded-hal icon indicating copy to clipboard operation
embedded-hal copied to clipboard

Add transmission done query mechanism to embedded-io serial traits (nonblocking flush).

Open MarSik opened this issue 9 months ago • 0 comments

The original serial traits supported the flush() -> nb::Result<> variant that could return WouldBlock. This was useful in async code that could wait for serial TxDone interrupt to trigger before checking again.

The traits in embedded-io only have blocking flush() call.

It could be argued that embedded-io contains only the blocking traits and embedded-io-async should be implemented for the non-blocking variants. However the ReadReady and WriteReady traits show that the non-blocking use case is important too.

MarSik avatar Apr 03 '25 17:04 MarSik