Skip to content

Commit

Permalink
tests: i2s_speed: Increase the RX buffer count
Browse files Browse the repository at this point in the history
The NXP I2S driver queues 2 receive buffers to avoid receive overflows.
Allocate an extra block so we do not see test failures due to allocate
failures

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
  • Loading branch information
mmahadevan108 authored and galak committed Jun 3, 2021
1 parent b06d084 commit a02704b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/drivers/i2s/i2s_speed/src/test_i2s_speed.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ static int16_t data_r[SAMPLE_NO] = {

#define BLOCK_SIZE (2 * sizeof(data_l))

K_MEM_SLAB_DEFINE(rx_0_mem_slab, BLOCK_SIZE, NUM_BLOCKS, 32);
/*
* NUM_BLOCKS is the number of blocks used by the test. Some of the drivers,
* e.g. i2s_mcux_flexcomm, permanently keep ownership of a few RX buffers. Add a few more
* RX blocks to satisfy this requirement
*/
K_MEM_SLAB_DEFINE(rx_0_mem_slab, BLOCK_SIZE, NUM_BLOCKS + 2, 32);
K_MEM_SLAB_DEFINE(tx_0_mem_slab, BLOCK_SIZE, NUM_BLOCKS, 32);

static void fill_buf(int16_t *tx_block, int att)
Expand Down

0 comments on commit a02704b

Please sign in to comment.