diff --git a/src/internal/Esp32_i2s.c b/src/internal/Esp32_i2s.c index 7ce7e63..4499601 100644 --- a/src/internal/Esp32_i2s.c +++ b/src/internal/Esp32_i2s.c @@ -26,7 +26,13 @@ #include "freertos/semphr.h" #include "freertos/queue.h" + +#if ESP_IDF_VERSION_MAJOR>=4 +#include "esp_intr_alloc.h" +#else #include "esp_intr.h" +#endif + #include "soc/gpio_reg.h" #include "soc/gpio_sig_map.h" #include "soc/io_mux_reg.h" @@ -40,7 +46,10 @@ #include "Esp32_i2s.h" #include "esp32-hal.h" +#if ESP_IDF_VERSION_MAJOR<4 #define I2S_BASE_CLK (160000000L) +#endif + #define ESP32_REG(addr) (*((volatile uint32_t*)(0x3FF00000+(addr)))) #define I2S_DMA_QUEUE_SIZE 16 @@ -171,7 +180,13 @@ esp_err_t i2sSetClock(uint8_t bus_num, uint8_t div_num, uint8_t div_b, uint8_t d return ESP_FAIL; } i2s_dev_t* i2s = I2S[bus_num].bus; + +#if !defined(CONFIG_IDF_TARGET_ESP32S2) i2s->clkm_conf.clka_en = 0; +#else + i2s->clkm_conf.clk_sel = 0; +#endif + i2s->clkm_conf.clkm_div_a = div_a; i2s->clkm_conf.clkm_div_b = div_b; i2s->clkm_conf.clkm_div_num = div_num; diff --git a/src/internal/NeoEsp32RmtMethod.h b/src/internal/NeoEsp32RmtMethod.h index 4675c21..97d6349 100644 --- a/src/internal/NeoEsp32RmtMethod.h +++ b/src/internal/NeoEsp32RmtMethod.h @@ -231,6 +231,8 @@ public: const static rmt_channel_t RmtChannelNumber = RMT_CHANNEL_3; }; +#if !defined(CONFIG_IDF_TARGET_ESP32S2) + class NeoEsp32RmtChannel4 { public: @@ -255,6 +257,8 @@ public: const static rmt_channel_t RmtChannelNumber = RMT_CHANNEL_7; }; +#endif + template class NeoEsp32RmtMethodBase { public: