Commit 41b92cc
tests: drivers: uart: async_api: Fix chain write
This fixes the case where uart_tx() called from tx callback
fill UART output fifo and immediately execute callback again.
This can happen when hardware does not have interrupt for
output FIFO empty and there is no non-blocking way to tell
that transfer finished.
For such case as soon as output FIFO is filled there is
interrupt that informs that more data can be transmitted.
For hardware with 32 byte fifo callback was seen to be
executed recursively 3 times.
That would not be a problem if chained_write_next_buf
was set BEFORE next call uart_tx().
Additionally semaphore max value is increased to 2
to accommodate such case.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg.xr@bp.renesas.com>1 parent c10f1e1 commit 41b92cc
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
836 | | - | |
837 | 836 | | |
| 837 | + | |
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
| |||
0 commit comments