Skip to content

Commit 942a292

Browse files
committed
feat(idf): Add support for IDF v5.4
1 parent 51ef2a1 commit 942a292

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# idf.py build
77

88
set(min_supported_idf_version "5.3.0")
9-
set(max_supported_idf_version "5.3.99")
9+
set(max_supported_idf_version "5.4.99")
1010
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH}")
1111

1212
if ("${idf_version}" AND NOT "$ENV{ARDUINO_SKIP_IDF_VERSION_CHECK}")

cores/esp32/esp32-hal-i2c-slave.c

+8
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,11 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
336336
#endif // !defined(CONFIG_IDF_TARGET_ESP32P4)
337337

338338
i2c_ll_slave_init(i2c->dev);
339+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
340+
i2c_ll_enable_fifo_mode(i2c->dev, true);
341+
#else
339342
i2c_ll_slave_set_fifo_mode(i2c->dev, true);
343+
#endif
340344
i2c_ll_set_slave_addr(i2c->dev, slaveID, false);
341345
i2c_ll_set_tout(i2c->dev, I2C_LL_MAX_TIMEOUT);
342346
i2c_slave_set_frequency(i2c, frequency);
@@ -357,7 +361,11 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t
357361

358362
i2c_ll_disable_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
359363
i2c_ll_clear_intr_mask(i2c->dev, I2C_LL_INTR_MASK);
364+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0)
365+
i2c_ll_enable_fifo_mode(i2c->dev, true);
366+
#else
360367
i2c_ll_slave_set_fifo_mode(i2c->dev, true);
368+
#endif
361369

362370
if (!i2c->intr_handle) {
363371
uint32_t flags = ESP_INTR_FLAG_LOWMED | ESP_INTR_FLAG_SHARED;

idf_component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ files:
4444
- "platform.txt"
4545
- "programmers.txt"
4646
dependencies:
47-
idf: ">=5.3,<5.4"
47+
idf: ">=5.3,<5.5"
4848
# mdns 1.2.1 is necessary to build H2 with no WiFi
4949
espressif/mdns:
5050
version: "^1.2.3"

0 commit comments

Comments
 (0)