From f0dc5aecf6542d4f43ff619baa5da6c6ace4d559 Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Sat, 13 Jan 2024 10:07:35 +0800 Subject: [PATCH] fix(i2s): fixed i2s incorrect tx mono slot (v4.4) --- components/hal/i2s_hal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/hal/i2s_hal.c b/components/hal/i2s_hal.c index b6d27f978d..9fc3ea2e7d 100644 --- a/components/hal/i2s_hal.c +++ b/components/hal/i2s_hal.c @@ -244,8 +244,13 @@ void i2s_hal_tx_set_channel_style(i2s_hal_context_t *hal, const i2s_hal_config_t uint32_t chan_num = 2; uint32_t chan_bits = hal_cfg->chan_bits; uint32_t data_bits = hal_cfg->sample_bits; +#if SOC_I2S_SUPPORTS_TDM + bool is_mono = (hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ALL_RIGHT) || + (hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ALL_LEFT); +#else bool is_mono = (hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ONLY_RIGHT) || (hal_cfg->chan_fmt == I2S_CHANNEL_FMT_ONLY_LEFT); +#endif /* Set channel number and valid data bits */ #if SOC_I2S_SUPPORTS_TDM