From d93b7246b010b06f195fc27ccf6683e94c2a272b Mon Sep 17 00:00:00 2001 From: laokaiyao Date: Fri, 23 Dec 2022 10:45:51 +0800 Subject: [PATCH] i2s: fixed rx update stuck bug --- components/hal/esp32c3/include/hal/i2s_ll.h | 4 ++-- components/hal/esp32h2/include/hal/i2s_ll.h | 4 ++-- components/hal/esp32s3/include/hal/i2s_ll.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/hal/esp32c3/include/hal/i2s_ll.h b/components/hal/esp32c3/include/hal/i2s_ll.h index 579f356768..438dc054ca 100644 --- a/components/hal/esp32c3/include/hal/i2s_ll.h +++ b/components/hal/esp32c3/include/hal/i2s_ll.h @@ -395,8 +395,8 @@ finish: */ static inline void i2s_ll_tx_start(i2s_dev_t *hw) { - hw->tx_conf.tx_update = 0; hw->tx_conf.tx_update = 1; + while (hw->tx_conf.tx_update); hw->tx_conf.tx_start = 1; } @@ -407,8 +407,8 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw) */ static inline void i2s_ll_rx_start(i2s_dev_t *hw) { - hw->rx_conf.rx_update = 0; hw->rx_conf.rx_update = 1; + while (hw->rx_conf.rx_update); hw->rx_conf.rx_start = 1; } diff --git a/components/hal/esp32h2/include/hal/i2s_ll.h b/components/hal/esp32h2/include/hal/i2s_ll.h index edbafcc252..3d509ace99 100644 --- a/components/hal/esp32h2/include/hal/i2s_ll.h +++ b/components/hal/esp32h2/include/hal/i2s_ll.h @@ -397,8 +397,8 @@ finish: */ static inline void i2s_ll_tx_start(i2s_dev_t *hw) { - hw->tx_conf.tx_update = 0; hw->tx_conf.tx_update = 1; + while (hw->tx_conf.tx_update); hw->tx_conf.tx_start = 1; } @@ -409,8 +409,8 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw) */ static inline void i2s_ll_rx_start(i2s_dev_t *hw) { - hw->rx_conf.rx_update = 0; hw->rx_conf.rx_update = 1; + while (hw->rx_conf.rx_update); hw->rx_conf.rx_start = 1; } diff --git a/components/hal/esp32s3/include/hal/i2s_ll.h b/components/hal/esp32s3/include/hal/i2s_ll.h index 14b4e6d4e7..eddeecb9e5 100644 --- a/components/hal/esp32s3/include/hal/i2s_ll.h +++ b/components/hal/esp32s3/include/hal/i2s_ll.h @@ -398,8 +398,8 @@ finish: */ static inline void i2s_ll_tx_start(i2s_dev_t *hw) { - hw->tx_conf.tx_update = 0; hw->tx_conf.tx_update = 1; + while (hw->tx_conf.tx_update); hw->tx_conf.tx_start = 1; } @@ -410,8 +410,8 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw) */ static inline void i2s_ll_rx_start(i2s_dev_t *hw) { - hw->rx_conf.rx_update = 0; hw->rx_conf.rx_update = 1; + while (hw->rx_conf.rx_update); hw->rx_conf.rx_start = 1; }