diff --git a/usermods/audioreactive/audio_source.h b/usermods/audioreactive/audio_source.h index a709d347..7407921d 100644 --- a/usermods/audioreactive/audio_source.h +++ b/usermods/audioreactive/audio_source.h @@ -3,6 +3,16 @@ #include #include "wled.h" #include +include +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0) +#include +#include +#endif + +//#include +//#include +//#include + /* ToDo: remove. ES7243 is controlled via compiler defines Until this configuration is moved to the webinterface @@ -88,7 +98,11 @@ class I2SSource : public AudioSource { .sample_rate = _sampleRate, .bits_per_sample = I2S_SAMPLE_RESOLUTION, .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0) + .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_STAND_I2S), +#else .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB), +#endif .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, .dma_buf_count = 8, .dma_buf_len = _blockSize @@ -307,7 +321,11 @@ class I2SAdcSource : public I2SSource { .sample_rate = _sampleRate, .bits_per_sample = I2S_SAMPLE_RESOLUTION, .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0) + .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_STAND_I2S), +#else .communication_format = i2s_comm_format_t(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB), +#endif .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2, .dma_buf_count = 8, .dma_buf_len = _blockSize