Skip to content

Commit

Permalink
pw_stream_uart_mcuxpresso: Make dma_stream Write of size 0 succeed
Browse files Browse the repository at this point in the history
This changes the behavior of the dma_stream implementation to always
have a write of size 0 succeed, rather than returning "invalid
argument". A write of size 0 is valid, and is required to be supported
by the RPC system. This also matches the behavior of the non-DMA stream.

Tested: Do a write of size 0, see that it succeeds
Change-Id: I8c5712ad130a69bf6fbe9645dd01ce04408bdfd8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/214151
Reviewed-by: Austin Foxley <[email protected]>
Commit-Queue: Eli Lipsitz <[email protected]>
Lint: Lint 🤖 <[email protected]>
Reviewed-by: Christoph Klee <[email protected]>
  • Loading branch information
elipsitz authored and CQ Bot Account committed Jun 5, 2024
1 parent 04b802b commit 52fcc2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pw_stream_uart_mcuxpresso/dma_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ StatusWithSize UartDmaStreamMcuxpresso::DoRead(ByteSpan data) {
// the USART TX channel.
Status UartDmaStreamMcuxpresso::DoWrite(ConstByteSpan data) {
if (data.size() == 0) {
return Status::InvalidArgument();
return OkStatus();
}

bool was_busy = tx_data_.busy.exchange(true);
Expand Down

0 comments on commit 52fcc2e

Please sign in to comment.