2022-11-22 02:14:51 -05:00
|
|
|
if(IDF_TARGET STREQUAL "esp32h2")
|
|
|
|
# TODO : IDF-6214
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2022-07-15 00:52:44 -04:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
|
|
|
set(includes "include" "interface" "${target}/include" "deprecated/include")
|
|
|
|
|
|
|
|
set(srcs "adc_cali.c"
|
|
|
|
"adc_cali_curve_fitting.c"
|
|
|
|
"adc_oneshot.c"
|
|
|
|
"adc_common.c"
|
|
|
|
"deprecated/esp_adc_cal_common_legacy.c")
|
|
|
|
|
|
|
|
if(CONFIG_SOC_ADC_DMA_SUPPORTED)
|
|
|
|
list(APPEND srcs "adc_continuous.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()
|
|
|
|
|
|
|
|
# legacy calibration driver
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/deprecated/${target}/esp_adc_cal_legacy.c")
|
|
|
|
list(APPEND srcs "deprecated/${target}/esp_adc_cal_legacy.c")
|
|
|
|
endif()
|
|
|
|
|
2022-07-08 05:09:16 -04:00
|
|
|
# ESP32C6-TODO
|
|
|
|
if(CONFIG_IDF_TARGET_ESP32C6)
|
|
|
|
list(REMOVE_ITEM srcs
|
|
|
|
"adc_cali_curve_fitting.c" # TODO: IDF-5312
|
|
|
|
"adc_oneshot.c" # TODO: IDF-5310
|
|
|
|
"adc_common.c"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-07-15 00:52:44 -04:00
|
|
|
idf_component_register(SRCS ${srcs}
|
|
|
|
INCLUDE_DIRS ${includes}
|
|
|
|
PRIV_REQUIRES driver efuse
|
|
|
|
LDFRAGMENTS linker.lf)
|