Skip to content

Commit e24223e

Browse files
ESP32: Fix compilation of I2S in Arduino ESP32 core 1.0.6 (#565)
1 parent 6d3b866 commit e24223e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/AudioOutputI2S.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ bool AudioOutputI2S::SetPinout()
8888
return false; // Not allowed
8989

9090
i2s_pin_config_t pins = {
91+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
9192
.mck_io_num = 0, // Unused
93+
#endif
9294
.bck_io_num = bclkPin,
9395
.ws_io_num = wclkPin,
9496
.data_out_num = doutPin,
@@ -229,8 +231,10 @@ bool AudioOutputI2S::begin(bool txDAC)
229231
.use_apll = use_apll, // Use audio PLL
230232
.tx_desc_auto_clear = true, // Silence on underflow
231233
.fixed_mclk = 0, // Unused
234+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
232235
.mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT, // Unused
233236
.bits_per_chan = I2S_BITS_PER_CHAN_DEFAULT // Use bits per sample
237+
#endif
234238
};
235239
audioLogger->printf("+%d %p\n", portNo, &i2s_config_dac);
236240
if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_dac, 0, NULL) != ESP_OK)

src/AudioOutputSPDIF.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ AudioOutputSPDIF::AudioOutputSPDIF(int dout_pin, int port, int dma_buf_count)
105105
.use_apll = true, // Audio PLL is needed for low clock jitter
106106
.tx_desc_auto_clear = true, // Silence on underflow
107107
.fixed_mclk = 0, // Unused
108+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
108109
.mclk_multiple = I2S_MCLK_MULTIPLE_DEFAULT, // Unused
109110
.bits_per_chan = I2S_BITS_PER_CHAN_DEFAULT // Use bits per sample
111+
#endif
110112
};
111113
if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_spdif, 0, NULL) != ESP_OK) {
112114
audioLogger->println(F("ERROR: Unable to install I2S drivers"));
@@ -151,7 +153,9 @@ bool AudioOutputSPDIF::SetPinout(int bclk, int wclk, int dout)
151153
{
152154
#if defined(ESP32)
153155
i2s_pin_config_t pins = {
156+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
154157
.mck_io_num = 0, // unused
158+
#endif
155159
.bck_io_num = bclk,
156160
.ws_io_num = wclk,
157161
.data_out_num = dout,

0 commit comments

Comments
 (0)