-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Async Uart that hasn't been split into UartRx and UartTx is missing async read and write functions, only blocking ones are present. Blocking read/write inside unsplit 'Uart' meanwhile are rerouted to inner rx/tx parts. So it should be possible to do the same for async read/write.
Also, async UartTx is missing flush, while the blocking version has it. From a quick look at the code, it seems that blocking_write returns when the input buffer is fully consumed, but the last byte might not be fully sent yet, which makes blocking_flush necessary. Async write seems to finish polling also when the buffer is fully consumed, not when all bits are sent(correct me if I'm wrong here). That would suggest async flush should also be present. Implementing that would be more difficult (enabling TXE interrupt, creating a new AtomicWaker for it, adding TXE to the interrupt handler, etc.)
I could try making a PR for this, but I only have a CH32V003 to test it on