Skip to content

Commit

Permalink
ESP32: Fix compilation of I2S in Arduino ESP32 core 1.0.6 (earlephilh…
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoBusero authored Aug 24, 2022
1 parent 6d3b866 commit e24223e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AudioOutputI2S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ bool AudioOutputI2S::SetPinout()
return false; // Not allowed

i2s_pin_config_t pins = {
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
.mck_io_num = 0, // Unused
#endif
.bck_io_num = bclkPin,
.ws_io_num = wclkPin,
.data_out_num = doutPin,
Expand Down Expand Up @@ -229,8 +231,10 @@ bool AudioOutputI2S::begin(bool txDAC)
.use_apll = use_apll, // Use audio PLL
.tx_desc_auto_clear = true, // Silence on underflow
.fixed_mclk = 0, // Unused
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
.mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT, // Unused
.bits_per_chan = I2S_BITS_PER_CHAN_DEFAULT // Use bits per sample
#endif
};
audioLogger->printf("+%d %p\n", portNo, &i2s_config_dac);
if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_dac, 0, NULL) != ESP_OK)
Expand Down
4 changes: 4 additions & 0 deletions src/AudioOutputSPDIF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ AudioOutputSPDIF::AudioOutputSPDIF(int dout_pin, int port, int dma_buf_count)
.use_apll = true, // Audio PLL is needed for low clock jitter
.tx_desc_auto_clear = true, // Silence on underflow
.fixed_mclk = 0, // Unused
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
.mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT, // Unused
.bits_per_chan = I2S_BITS_PER_CHAN_DEFAULT // Use bits per sample
#endif
};
if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_spdif, 0, NULL) != ESP_OK) {
audioLogger->println(F("ERROR: Unable to install I2S drivers"));
Expand Down Expand Up @@ -151,7 +153,9 @@ bool AudioOutputSPDIF::SetPinout(int bclk, int wclk, int dout)
{
#if defined(ESP32)
i2s_pin_config_t pins = {
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
.mck_io_num = 0, // unused
#endif
.bck_io_num = bclk,
.ws_io_num = wclk,
.data_out_num = dout,
Expand Down

0 comments on commit e24223e

Please sign in to comment.