Skip to content

Commit e712f60

Browse files
Fix I2S compilation on IDF 6.0-beta2 (#89)
* fix: i2s compilation on IDF 6.0-beta2 * Fix i2s_periph.h include for IDF 4.x The conditional from the cherry-pick only included soc/i2s_periph.h for IDF >= 5.4.0, leaving IDF 4.x without it. Change the elif to else so all non-6.0 versions get the header. --------- Co-authored-by: Aiden <aiden@vigue.me>
1 parent e4b3ac6 commit e712f60

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

components/hub75/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ if(IDF_TARGET STREQUAL "esp32p4" OR IDF_TARGET STREQUAL "esp32c6")
1414
endif()
1515
# ESP-IDF 6.0+ split drivers into separate components
1616
if(IDF_VERSION_MAJOR GREATER_EQUAL 6)
17-
list(APPEND HUB75_REQUIRES esp_driver_gpio)
17+
list(REMOVE_ITEM HUB75_REQUIRES driver) # Remove old "driver" component
18+
list(APPEND HUB75_REQUIRES esp_driver_gpio)
19+
if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2")
20+
list(APPEND HUB75_REQUIRES esp_driver_i2s)
21+
endif()
1822
if(IDF_TARGET STREQUAL "esp32p4" OR IDF_TARGET STREQUAL "esp32c6")
1923
list(APPEND HUB75_REQUIRES esp_driver_parlio)
2024
endif()

components/hub75/src/platforms/i2s/i2s_dma.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,14 @@
3030
#include <driver/periph_ctrl.h>
3131
#endif
3232
#include <soc/gpio_sig_map.h>
33+
34+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 0, 0) && !__has_include("soc/i2s_periph.h")
35+
#include <driver/i2s_std.h>
36+
#include <soc/i2s_reg.h>
37+
#else
3338
#include <soc/i2s_periph.h>
39+
#endif
40+
3441
#include <esp_heap_caps.h>
3542

3643
static const char *const TAG = "I2sDma";

0 commit comments

Comments
 (0)