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 <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2021-07-28 23:49:14 +02:00 committed by Christopher Friedt
commit dd465c48cb
3 changed files with 6 additions and 0 deletions

View file

@ -110,6 +110,8 @@ static int test_fifo_read(void)
data_received = false; data_received = false;
while (data_received == false) { while (data_received == false) {
/* Allow other thread/workqueue to work. */
k_yield();
} }
/* Verify uart_irq_rx_disable() */ /* Verify uart_irq_rx_disable() */

View file

@ -124,6 +124,8 @@ static int test_pending(void)
TC_PRINT("Please send characters to serial console\n"); TC_PRINT("Please send characters to serial console\n");
while (status == WAIT) { while (status == WAIT) {
/* Allow other thread/workqueue to work. */
k_yield();
/* /*
* Wait RX handler change 'status' properly: * Wait RX handler change 'status' properly:
* it will change to PASSED or FAILED after * it will change to PASSED or FAILED after

View file

@ -23,6 +23,8 @@ static int test_poll_in(void)
/* Verify uart_poll_in() */ /* Verify uart_poll_in() */
while (1) { while (1) {
while (uart_poll_in(uart_dev, &recv_char) < 0) { while (uart_poll_in(uart_dev, &recv_char) < 0) {
/* Allow other thread/workqueue to work. */
k_yield();
} }
TC_PRINT("%c", recv_char); TC_PRINT("%c", recv_char);