@@ -226,6 +226,10 @@ static void free_rx_buffer(struct i2s_nrfx_drv_data *drv_data, void *buffer)
226
226
static bool supply_next_buffers (struct i2s_nrfx_drv_data * drv_data ,
227
227
nrfx_i2s_buffers_t * next )
228
228
{
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
+
229
233
drv_data -> last_tx_buffer = next -> p_tx_buffer ;
230
234
231
235
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,
236
240
}
237
241
}
238
242
243
+ next -> buffer_size = block_size / sizeof (uint32_t );
244
+
239
245
LOG_DBG ("Next buffers: %p/%p" , next -> p_tx_buffer , next -> p_rx_buffer );
240
246
nrfx_i2s_next_buffers_set (drv_data -> p_i2s , next );
241
247
return true;
@@ -661,10 +667,10 @@ static int start_transfer(struct i2s_nrfx_drv_data *drv_data)
661
667
: drv_data -> rx .cfg .block_size ;
662
668
nrfx_err_t err ;
663
669
670
+ initial_buffers .buffer_size = block_size / sizeof (uint32_t );
664
671
drv_data -> last_tx_buffer = initial_buffers .p_tx_buffer ;
665
672
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 );
668
674
if (err == NRFX_SUCCESS ) {
669
675
return 0 ;
670
676
}
0 commit comments