Skip to content

Commit a5107fb

Browse files
mariopajakartben
authored andcommitted
drivers: i2s: stm32_sai set mem_block to NULL after STOPPING
Set mem_block to NULL after the STOPPING command in order to exit TX callback at the end of the buffer transmission. Signed-off-by: Mario Paja <[email protected]>
1 parent abb3c2a commit a5107fb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/i2s/i2s_stm32_sai.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
155155
if (stream->last_block) {
156156
LOG_DBG("TX Stopped ...");
157157
stream->state = I2S_STATE_READY;
158+
stream->mem_block = NULL;
158159
goto exit;
159160
}
160161

@@ -163,6 +164,7 @@ void HAL_SAI_TxCpltCallback(SAI_HandleTypeDef *hsai)
163164
if (k_msgq_num_used_get(&stream->queue) == 0) {
164165
LOG_DBG("Exit TX callback, no more data in the queue");
165166
stream->state = I2S_STATE_READY;
167+
stream->mem_block = NULL;
166168
goto exit;
167169
}
168170

0 commit comments

Comments
 (0)