Skip to content

Commit

Permalink
tests/drivers: i2s: Fix use of k_sleep
Browse files Browse the repository at this point in the history
k_sleep requires k_timeout_t as argument.
Use K_USEC helper when required in i2s driver tests.

Fixes zephyrproject-rtos#25180

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
  • Loading branch information
erwango committed May 11, 2020
1 parent 55882ac commit c2a77db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/drivers/i2s/i2s_api/src/test_i2s_loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void test_i2s_transfer_restart(void)
TC_PRINT("Stop transmission\n");

/* Keep interface inactive */
k_sleep(TEST_I2S_TRANSFER_RESTART_PAUSE_LENGTH_US);
k_sleep(K_USEC(TEST_I2S_TRANSFER_RESTART_PAUSE_LENGTH_US));

TC_PRINT("Start transmission\n");

Expand Down Expand Up @@ -396,7 +396,7 @@ void test_i2s_transfer_rx_overrun(void)
zassert_equal(ret, 0, "TX DRAIN trigger failed");

/* Wait for transmission to finish */
k_sleep(TEST_I2S_TRANSFER_RX_OVERRUN_PAUSE_LENGTH_US);
k_sleep(K_USEC(TEST_I2S_TRANSFER_RX_OVERRUN_PAUSE_LENGTH_US));

/* Read all available data blocks in RX queue */
for (int i = 0; i < NUM_RX_BLOCKS; i++) {
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/i2s/i2s_api/src/test_i2s_states.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void test_i2s_state_error_neg(void)
}

/* Wait for transmission to finish */
k_sleep(TEST_I2S_STATE_ERROR_NEG_PAUSE_LENGTH_US);
k_sleep(K_USEC(TEST_I2S_STATE_ERROR_NEG_PAUSE_LENGTH_US));

/* Read all available data blocks in RX queue */
for (int i = 0; i < NUM_RX_BLOCKS; i++) {
Expand Down

0 comments on commit c2a77db

Please sign in to comment.