Skip to content

Commit 2dee952

Browse files
tmon-nordiccarlescufi
authored andcommitted
modules: hal_nordic: nrfx: update API version to 3.3.0
Update i2s nrfx driver to pass buffer size alongside buffer pointers. No functional changes. Signed-off-by: Tomasz Moń <[email protected]>
1 parent 0b7fb57 commit 2dee952

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/i2s/i2s_nrfx.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ static void free_rx_buffer(struct i2s_nrfx_drv_data *drv_data, void *buffer)
226226
static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data,
227227
nrfx_i2s_buffers_t *next)
228228
{
229+
uint32_t block_size = (drv_data->active_dir == I2S_DIR_TX)
230+
? drv_data->tx.cfg.block_size
231+
: drv_data->rx.cfg.block_size;
232+
229233
drv_data->last_tx_buffer = next->p_tx_buffer;
230234

231235
if (drv_data->active_dir != I2S_DIR_TX) { /* -> RX active */
@@ -236,6 +240,8 @@ static bool supply_next_buffers(struct i2s_nrfx_drv_data *drv_data,
236240
}
237241
}
238242

243+
next->buffer_size = block_size / sizeof(uint32_t);
244+
239245
LOG_DBG("Next buffers: %p/%p", next->p_tx_buffer, next->p_rx_buffer);
240246
nrfx_i2s_next_buffers_set(drv_data->p_i2s, next);
241247
return true;
@@ -661,10 +667,10 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data)
661667
: drv_data->rx.cfg.block_size;
662668
nrfx_err_t err;
663669

670+
initial_buffers.buffer_size = block_size / sizeof(uint32_t);
664671
drv_data->last_tx_buffer = initial_buffers.p_tx_buffer;
665672

666-
err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers,
667-
block_size / sizeof(uint32_t), 0);
673+
err = nrfx_i2s_start(drv_data->p_i2s, &initial_buffers, 0);
668674
if (err == NRFX_SUCCESS) {
669675
return 0;
670676
}

modules/hal_nordic/nrfx/nrfx_config_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
/** @brief Symbol specifying minor version of the nrfx API to be used. */
2020
#ifndef NRFX_CONFIG_API_VER_MINOR
21-
#define NRFX_CONFIG_API_VER_MINOR 2
21+
#define NRFX_CONFIG_API_VER_MINOR 3
2222
#endif
2323

2424
/** @brief Symbol specifying micro version of the nrfx API to be used. */

0 commit comments

Comments
 (0)