i2s: fixed rx update stuck bug

This commit is contained in:
laokaiyao
2022-12-19 12:27:40 +08:00
parent cd5f2c3d76
commit f44aa9bcc5
4 changed files with 16 additions and 14 deletions

View File

@@ -419,12 +419,10 @@ finish:
*/ */
static inline void i2s_ll_tx_start(i2s_dev_t *hw) static inline void i2s_ll_tx_start(i2s_dev_t *hw)
{ {
// TODO: solve the bug that can't update // Have to update registers before start
// hw->tx_conf.tx_update = 0;
while (hw->tx_conf.tx_update);
hw->tx_conf.tx_update = 1; hw->tx_conf.tx_update = 1;
hw->tx_conf.tx_start = 1;
while (hw->tx_conf.tx_update); while (hw->tx_conf.tx_update);
hw->tx_conf.tx_start = 1;
} }
/** /**
@@ -434,12 +432,10 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw)
*/ */
static inline void i2s_ll_rx_start(i2s_dev_t *hw) static inline void i2s_ll_rx_start(i2s_dev_t *hw)
{ {
// TODO: solve the bug that can't update // Have to update registers before start
// hw->rx_conf.rx_update = 0;
while (hw->rx_conf.rx_update);
hw->rx_conf.rx_update = 1; hw->rx_conf.rx_update = 1;
hw->rx_conf.rx_start = 1;
while (hw->rx_conf.rx_update); while (hw->rx_conf.rx_update);
hw->rx_conf.rx_start = 1;
} }
/** /**

View File

@@ -434,8 +434,9 @@ finish:
*/ */
static inline void i2s_ll_tx_start(i2s_dev_t *hw) static inline void i2s_ll_tx_start(i2s_dev_t *hw)
{ {
hw->tx_conf.tx_update = 0; // Have to update registers before start
hw->tx_conf.tx_update = 1; hw->tx_conf.tx_update = 1;
while (hw->tx_conf.tx_update);
hw->tx_conf.tx_start = 1; hw->tx_conf.tx_start = 1;
} }
@@ -446,8 +447,9 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw)
*/ */
static inline void i2s_ll_rx_start(i2s_dev_t *hw) static inline void i2s_ll_rx_start(i2s_dev_t *hw)
{ {
hw->rx_conf.rx_update = 0; // Have to update registers before start
hw->rx_conf.rx_update = 1; hw->rx_conf.rx_update = 1;
while (hw->rx_conf.rx_update);
hw->rx_conf.rx_start = 1; hw->rx_conf.rx_start = 1;
} }

View File

@@ -420,8 +420,9 @@ finish:
*/ */
static inline void i2s_ll_tx_start(i2s_dev_t *hw) static inline void i2s_ll_tx_start(i2s_dev_t *hw)
{ {
hw->tx_conf.tx_update = 0; // Have to update registers before start
hw->tx_conf.tx_update = 1; hw->tx_conf.tx_update = 1;
while (hw->tx_conf.tx_update);
hw->tx_conf.tx_start = 1; hw->tx_conf.tx_start = 1;
} }
@@ -432,8 +433,9 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw)
*/ */
static inline void i2s_ll_rx_start(i2s_dev_t *hw) static inline void i2s_ll_rx_start(i2s_dev_t *hw)
{ {
hw->rx_conf.rx_update = 0; // Have to update registers before start
hw->rx_conf.rx_update = 1; hw->rx_conf.rx_update = 1;
while (hw->rx_conf.rx_update);
hw->rx_conf.rx_start = 1; hw->rx_conf.rx_start = 1;
} }

View File

@@ -419,8 +419,9 @@ finish:
*/ */
static inline void i2s_ll_tx_start(i2s_dev_t *hw) static inline void i2s_ll_tx_start(i2s_dev_t *hw)
{ {
hw->tx_conf.tx_update = 0; // Have to update registers before start
hw->tx_conf.tx_update = 1; hw->tx_conf.tx_update = 1;
while (hw->tx_conf.tx_update);
hw->tx_conf.tx_start = 1; hw->tx_conf.tx_start = 1;
} }
@@ -431,8 +432,9 @@ static inline void i2s_ll_tx_start(i2s_dev_t *hw)
*/ */
static inline void i2s_ll_rx_start(i2s_dev_t *hw) static inline void i2s_ll_rx_start(i2s_dev_t *hw)
{ {
hw->rx_conf.rx_update = 0; // Have to update registers before start
hw->rx_conf.rx_update = 1; hw->rx_conf.rx_update = 1;
while (hw->rx_conf.rx_update);
hw->rx_conf.rx_start = 1; hw->rx_conf.rx_start = 1;
} }