In CMakeLists.txt, a logic like below is often needed.
# check if the IDF_VERSION has esp_driver_* components
set(HAS_ESP_DRIVERS TRUE)
if(${IDF_VERSION_MAJOR} STREQUAL 5 AND ${IDF_VERSION_MINOR} LESS 3)
set(HAS_ESP_DRIVERS FALSE)
endif()
Such logic is common in many drivers. Other use case: HAS_PCNT, which signals a chip supports PCNT.
Solution: Create a file to define common logics.
In
CMakeLists.txt, a logic like below is often needed.Such logic is common in many drivers. Other use case:
HAS_PCNT, which signals a chip supports PCNT.Solution: Create a file to define common logics.