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 authored and aescolar committed May 28, 2024
1 parent c27ed31 commit fdd6627
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 @@ -932,6 +932,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 fdd6627

Please sign in to comment.