mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Rename the internal ULP child-build marker to __ULP_BUILDV2 so component CMake files make the build-system scope explicit. Document that the marker is currently set only by the IDF_BUILD_V2 ULP child path.
71 lines
2.2 KiB
CMake
71 lines
2.2 KiB
CMake
idf_build_get_property(target IDF_TARGET)
|
|
|
|
if(${target} STREQUAL "linux")
|
|
return() # This component is not supported by the POSIX/Linux simulator
|
|
endif()
|
|
|
|
set(includes "include" "interface" "${target}/include")
|
|
|
|
# TODO(IDF-15983): potentially remove __ULP_BUILDV2 handling from esp_adc
|
|
if(__ULP_BUILDV2)
|
|
# LP-core ADC shared code includes esp_adc/adc_oneshot.h from
|
|
# ulp/lp_core/shared/include/ulp_lp_core_lp_adc_shared.h.
|
|
idf_component_register(INCLUDE_DIRS ${includes}
|
|
REQUIRES esp_hal_ana_conv)
|
|
return()
|
|
endif()
|
|
|
|
set(srcs)
|
|
|
|
if(CONFIG_SOC_ADC_SUPPORTED)
|
|
list(APPEND srcs
|
|
"adc_oneshot.c"
|
|
"adc_common.c"
|
|
"adc_cali.c"
|
|
"adc_cali_curve_fitting.c"
|
|
)
|
|
|
|
if(CONFIG_SOC_ADC_DMA_SUPPORTED)
|
|
list(APPEND srcs "adc_continuous.c")
|
|
if(CONFIG_SOC_ADC_MONITOR_SUPPORTED)
|
|
list(APPEND srcs "adc_monitor.c")
|
|
endif()
|
|
if(CONFIG_SOC_GDMA_SUPPORTED)
|
|
list(APPEND srcs "gdma/adc_dma.c")
|
|
elseif(${target} STREQUAL "esp32")
|
|
list(APPEND srcs "esp32/adc_dma.c")
|
|
elseif(${target} STREQUAL "esp32s2")
|
|
list(APPEND srcs "esp32s2/adc_dma.c")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
if(CONFIG_SOC_ADC_DIG_IIR_FILTER_SUPPORTED)
|
|
list(APPEND srcs "adc_filter.c")
|
|
endif()
|
|
|
|
# line fitting scheme
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/adc_cali_line_fitting.c")
|
|
list(APPEND srcs "${target}/adc_cali_line_fitting.c")
|
|
endif()
|
|
|
|
# curve fitting scheme coefficients
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${target}/curve_fitting_coefficients.c")
|
|
list(APPEND srcs "${target}/curve_fitting_coefficients.c")
|
|
endif()
|
|
|
|
set(extra_requires)
|
|
idf_build_get_property(target IDF_TARGET)
|
|
if(${target} STREQUAL "esp32")
|
|
list(APPEND extra_requires esp_driver_i2s)
|
|
endif()
|
|
if(${target} STREQUAL "esp32s2")
|
|
list(APPEND extra_requires esp_driver_spi)
|
|
endif()
|
|
|
|
idf_component_register(SRCS ${srcs}
|
|
INCLUDE_DIRS ${includes}
|
|
PRIV_REQUIRES esp_driver_gpio esp_driver_dma efuse esp_pm esp_ringbuf esp_mm ${extra_requires}
|
|
REQUIRES esp_hal_ana_conv
|
|
LDFRAGMENTS linker.lf)
|