Skip to content

Commit

Permalink
Fix esp-idf 5.3 & 5.4 version Compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed May 23, 2024
1 parent 2c49a76 commit 8a43e34
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/XPowersCommon.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ public:
.dev_addr_length = I2C_ADDR_BIT_LEN_7,
.device_address = addr,
.scl_speed_hz = XPOWERSLIB_I2C_MASTER_SEEED,
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5,3,0))
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5,4,0))
// New fields since esp-idf-v5.3-beta1
.scl_wait_us = 0,
#endif
.flags = {
. disable_ack_check = 0
}
#endif
};

if (ESP_OK != i2c_master_bus_add_device(bus_handle,
Expand Down

0 comments on commit 8a43e34

Please sign in to comment.