]> granicus.if.org Git - esp-idf/commitdiff
Bugfix(i2s): fixed i2s left/right channels swapped issue.
authorredchenjs <redchenjs@live.com>
Mon, 1 Jul 2019 11:48:47 +0000 (19:48 +0800)
committerkooho <2229179028@qq.com>
Wed, 31 Jul 2019 09:58:23 +0000 (17:58 +0800)
The right channel data is in the high position, so the I2S_TX_MSB_RIGHT & I2S_RX_MSB_RIGHT bits should be set.

Merges https://github.com/espressif/esp-idf/pull/3717

closes https://github.com/espressif/esp-idf/issues/3399

components/driver/i2s.c

index 56c418d153bed7962b8f6fe9610c0d0ea8794d1e..d0c9831b87176e184a44c06b736aa86e1c04c36c 100644 (file)
@@ -944,7 +944,7 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
     I2S[i2s_num]->conf.rx_start = 0;
 
     if (i2s_config->mode & I2S_MODE_TX) {
-        I2S[i2s_num]->conf.tx_msb_right = 0;
+        I2S[i2s_num]->conf.tx_msb_right = 1;
         I2S[i2s_num]->conf.tx_right_first = 0;
 
         I2S[i2s_num]->conf.tx_slave_mod = 0; // Master
@@ -956,7 +956,7 @@ static esp_err_t i2s_param_config(i2s_port_t i2s_num, const i2s_config_t *i2s_co
     }
 
     if (i2s_config->mode & I2S_MODE_RX) {
-        I2S[i2s_num]->conf.rx_msb_right = 0;
+        I2S[i2s_num]->conf.rx_msb_right = 1;
         I2S[i2s_num]->conf.rx_right_first = 0;
         I2S[i2s_num]->conf.rx_slave_mod = 0; // Master
         I2S[i2s_num]->fifo_conf.rx_fifo_mod_force_en = 1;