Skip to content

Commit dd465c4

Browse files
jfischer-nocfriedt
authored andcommitted
tests: uart_basic_api: allow USB workqueue/thread to work
Allow UART driver that offload interrupt processing to workuqueue, like CDC ACM UART to work. Signed-off-by: Johann Fischer <[email protected]>
1 parent c3313c1 commit dd465c4

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

tests/drivers/uart/uart_basic_api/src/test_uart_fifo.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ static int test_fifo_read(void)
110110

111111
data_received = false;
112112
while (data_received == false) {
113+
/* Allow other thread/workqueue to work. */
114+
k_yield();
113115
}
114116

115117
/* Verify uart_irq_rx_disable() */

tests/drivers/uart/uart_basic_api/src/test_uart_pending.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ static int test_pending(void)
124124
TC_PRINT("Please send characters to serial console\n");
125125

126126
while (status == WAIT) {
127+
/* Allow other thread/workqueue to work. */
128+
k_yield();
127129
/*
128130
* Wait RX handler change 'status' properly:
129131
* it will change to PASSED or FAILED after

tests/drivers/uart/uart_basic_api/src/test_uart_poll.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ static int test_poll_in(void)
2323
/* Verify uart_poll_in() */
2424
while (1) {
2525
while (uart_poll_in(uart_dev, &recv_char) < 0) {
26+
/* Allow other thread/workqueue to work. */
27+
k_yield();
2628
}
2729

2830
TC_PRINT("%c", recv_char);

0 commit comments

Comments
 (0)