Added support for new i2c drivers

This commit is contained in:
nopnop2002
2025-06-14 16:50:49 +09:00
parent c4d8e72e8e
commit 4b722e35c7
8 changed files with 236 additions and 92 deletions

View File

@@ -1,3 +1,16 @@
set(component_srcs "mpr121.c")
# get IDF version for comparison
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
if(idf_version VERSION_GREATER_EQUAL "5.2")
if(CONFIG_LEGACY_DRIVER)
list(APPEND component_srcs "i2c_legacy.c")
else()
list(APPEND component_srcs "i2c_new.c")
endif()
else()
list(APPEND component_srcs "i2c_legacy.c")
endif()
idf_component_register(SRCS "${component_srcs}" PRIV_REQUIRES driver INCLUDE_DIRS ".")