diff --git a/.eil.yml b/.eil.yml index 7cfd1fb..76164ec 100644 --- a/.eil.yml +++ b/.eil.yml @@ -5,6 +5,8 @@ groups: - common code_owners: - UncleRus + - quinkq + - trombik depends: - driver - freertos @@ -25,4 +27,6 @@ targets: license: MIT copyrights: - name: UncleRus - year: 2018 \ No newline at end of file + year: 2018 + - name: quinkq + year: 2025 diff --git a/CMakeLists.txt b/CMakeLists.txt index f98fc70..a7ee126 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ # ESP-IDF CMake component for i2cdev library -set(req driver freertos esp_idf_lib_helpers) +if(${IDF_VERSION_MAJOR} STREQUAL 5 AND ${IDF_VERSION_MINOR} LESS 3) + # Use driver component as esp_driver_gpio is not available before 5.3 + set(req driver freertos log esp_timer) +else() + set(req esp_driver_gpio esp_driver_i2c freertos esp_idf_lib_helpers) +endif() # ESP-IDF version detection for automatic driver selection # Check for manual override via Kconfig @@ -14,7 +19,7 @@ elseif(IDF_VERSION_MAJOR LESS 5) set(USE_LEGACY_DRIVER TRUE) message(STATUS "i2cdev: ESP-IDF v${IDF_VERSION_MAJOR}.x detected, using legacy driver") elseif(IDF_VERSION_MAJOR EQUAL 5 AND IDF_VERSION_MINOR LESS 3) - set(USE_LEGACY_DRIVER TRUE) + set(USE_LEGACY_DRIVER TRUE) message(STATUS "i2cdev: ESP-IDF v${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR} detected, using legacy driver") else() set(USE_LEGACY_DRIVER FALSE) diff --git a/i2cdev.h b/i2cdev.h index 1cde925..4dab9ba 100644 --- a/i2cdev.h +++ b/i2cdev.h @@ -46,12 +46,18 @@ #ifndef __I2CDEV_H__ #define __I2CDEV_H__ -#include -#include #include #include #include #include +#include + +#include +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0) +#include +#else +#include +#endif // Define missing types for older ESP-IDF versions #if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 2, 0)