From 0ad1af012911feeb78cc4233cab376d58927da44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=A3=D1=81?= Date: Fri, 25 Sep 2026 14:10:13 +0500 Subject: [PATCH 1/3] chore: switch to eil-cmake-utils --- .astylerc.old-style | 17 ----------------- .eil.yml | 2 +- .gitmodules | 6 +++--- CMakeLists.txt | 29 ++++++++++++++++------------- Kconfig.i2c | 19 ------------------- common | 1 - eil-cmake-utils | 1 + idf_component.yml | 2 +- 8 files changed, 22 insertions(+), 55 deletions(-) delete mode 100644 .astylerc.old-style delete mode 100644 Kconfig.i2c delete mode 160000 common create mode 160000 eil-cmake-utils diff --git a/.astylerc.old-style b/.astylerc.old-style deleted file mode 100644 index 30389ce..0000000 --- a/.astylerc.old-style +++ /dev/null @@ -1,17 +0,0 @@ ---align-reference=name ---attach-classes ---attach-classes ---attach-namespaces ---convert-tabs ---exclude=build ---exclude=common ---exclude=managed_components ---ignore-exclude-errors ---indent-switches ---indent=spaces=4 ---keep-one-line-statements ---max-continuation-indent=120 ---pad-header ---pad-oper ---style=allman ---unpad-paren diff --git a/.eil.yml b/.eil.yml index 39c7daa..7ef6832 100644 --- a/.eil.yml +++ b/.eil.yml @@ -1,7 +1,7 @@ --- name: shiftregister description: Generic shift register driver -version: 1.0.0 +version: 1.0.1 groups: - common code_owners: diff --git a/.gitmodules b/.gitmodules index a9554a2..928766e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "common"] - path = common - url = https://github.com/esp-idf-lib/common.git +[submodule "eil-cmake-utils"] + path = eil-cmake-utils + url = git@github.com:esp-idf-lib/eil-cmake-utils.git diff --git a/CMakeLists.txt b/CMakeLists.txt index f1a03b5..a660726 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,20 @@ -if(${IDF_VERSION_MAJOR} STREQUAL 5 AND ${IDF_VERSION_MINOR} STRLESS 3) - set(priv_requires driver) -else() - set(priv_requires esp_driver_gpio) -endif() +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/eil-cmake-utils/cmake) +include(eil_check_idf_features) +eil_check_idf_has_esp_drivers() -idf_component_register(SRCS "shiftregister_gpio.c" - PRIV_REQUIRES ${priv_requires} - INCLUDE_DIRS "include") +# List of common ESP-IDF components required by this component +set(REQUIRED_COMPONENTS log) -# include common cmake file for components -set(ESP_IDF_LIB_CMAKE ${CMAKE_CURRENT_LIST_DIR}/common/cmake/esp-idf-lib.cmake) -if(EXISTS ${ESP_IDF_LIB_CMAKE}) - include(${ESP_IDF_LIB_CMAKE}) +if(EIL_IDF_HAS_ESP_DRIVERS) + list(APPEND REQUIRED_COMPONENTS esp_driver_gpio) else() - message(WARNING "${ESP_IDF_LIB_CMAKE} not found") + list(APPEND REQUIRED_COMPONENTS driver) endif() + +idf_component_register( + SRCS shiftregister_gpio.c + INCLUDE_DIRS . + REQUIRES ${REQUIRED_COMPONENTS} +) + +include(eil_ci) diff --git a/Kconfig.i2c b/Kconfig.i2c deleted file mode 100644 index 29d0ac2..0000000 --- a/Kconfig.i2c +++ /dev/null @@ -1,19 +0,0 @@ -config EXAMPLE_I2C_MASTER_SCL - int "SCL GPIO Number" - default 5 if IDF_TARGET_ESP8266 - default 6 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C61 - default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 4 if IDF_TARGET_ESP32H2 - default 4 if IDF_TARGET_ESP32P4 - help - GPIO number for I2C Master clock line. - -config EXAMPLE_I2C_MASTER_SDA - int "SDA GPIO Number" - default 4 if IDF_TARGET_ESP8266 - default 5 if IDF_TARGET_ESP32C2 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C61 - default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 - default 3 if IDF_TARGET_ESP32H2 - default 3 if IDF_TARGET_ESP32P4 - help - GPIO number for I2C Master data line. diff --git a/common b/common deleted file mode 160000 index 12347bc..0000000 --- a/common +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 12347bc4f4f897838b9bab78a6c24e5fe46aae02 diff --git a/eil-cmake-utils b/eil-cmake-utils new file mode 160000 index 0000000..c91055e --- /dev/null +++ b/eil-cmake-utils @@ -0,0 +1 @@ +Subproject commit c91055e05b68b6f0cdbd73969e725d0b91aa25fa diff --git a/idf_component.yml b/idf_component.yml index 62375eb..98cba7f 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,6 +1,6 @@ --- version: 1.0.0 -description: "This is a template component" +description: "Generic shift register driver" license: "MIT" targets: - esp32 From f413bff806faca8d1876bd51114991f039514183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=A3=D1=81?= Date: Fri, 25 Sep 2026 14:12:41 +0500 Subject: [PATCH 2/3] chore: sync component versions --- idf_component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/idf_component.yml b/idf_component.yml index 98cba7f..3ebe32f 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -1,5 +1,5 @@ --- -version: 1.0.0 +version: 1.0.1 description: "Generic shift register driver" license: "MIT" targets: From e99e957f49aa04d127bccab94db1cdfc4fc585fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=A3=D1=81?= Date: Fri, 25 Sep 2026 14:26:25 +0500 Subject: [PATCH 3/3] chore: fix include dir --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a660726..8acef73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,7 @@ endif() idf_component_register( SRCS shiftregister_gpio.c - INCLUDE_DIRS . + INCLUDE_DIRS "include" REQUIRES ${REQUIRED_COMPONENTS} )