Skip to content

Commit

Permalink
drivers: i2s: i2s_ll_stm32: tx_stream_disable: Add busy wait
Browse files Browse the repository at this point in the history
Add a k_busy_wait to the function tx_stream_disable
to be able to complete the drain of the TX queue before disabling.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
  • Loading branch information
marwaiehm-st committed May 27, 2024
1 parent 003f1ca commit 9933300
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/i2s/i2s_ll_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,8 @@ static void tx_stream_disable(struct stream *stream, const struct device *dev)
stream->mem_block = NULL;
}

/* Wait for TX queue to drain before disabling */
k_busy_wait(100);
LL_I2S_Disable(cfg->i2s);

active_dma_tx_channel[stream->dma_channel] = NULL;
Expand Down

0 comments on commit 9933300

Please sign in to comment.