2018-11-19 03:46:21 +00:00
|
|
|
set(SOC_NAME ${IDF_TARGET})
|
|
|
|
|
|
|
|
if(EXISTS "${COMPONENT_PATH}/${SOC_NAME}")
|
|
|
|
include(${COMPONENT_PATH}/${SOC_NAME}/sources.cmake)
|
|
|
|
spaces2list(EFUSE_SOC_SRCS)
|
|
|
|
add_prefix(COMPONENT_SRCS "${SOC_NAME}/" ${EFUSE_SOC_SRCS})
|
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS include
|
|
|
|
${SOC_NAME}/include)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
list(APPEND COMPONENT_SRCS "src/esp_efuse_api.c"
|
|
|
|
"src/esp_efuse_fields.c"
|
|
|
|
"src/esp_efuse_utility.c")
|
|
|
|
|
|
|
|
set(COMPONENT_REQUIRES)
|
|
|
|
set(COMPONENT_PRIV_REQUIRES bootloader_support)
|
|
|
|
register_component()
|
|
|
|
|
2018-12-18 14:42:10 +00:00
|
|
|
set(GEN_EFUSE_TABLE_ARG --max_blk_len ${CONFIG_EFUSE_MAX_BLK_LEN})
|
2018-11-21 08:09:36 +00:00
|
|
|
|
2018-11-19 03:46:21 +00:00
|
|
|
###################
|
|
|
|
# Make common files esp_efuse_table.c and include/esp_efuse_table.h files.
|
|
|
|
set(EFUSE_COMMON_TABLE_CSV_PATH "${COMPONENT_PATH}/${SOC_NAME}/esp_efuse_table.csv")
|
2018-12-06 09:49:02 +00:00
|
|
|
|
|
|
|
add_custom_target(efuse_common_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_COMMON_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG})
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-11-21 08:09:36 +00:00
|
|
|
###################
|
|
|
|
# Make custom files project/main/esp_efuse_custom_table.c and project/main/include/esp_efuse_custom_table.h files.
|
|
|
|
# Path to CSV file is relative to project path for custom CSV files.
|
2018-11-19 03:46:21 +00:00
|
|
|
if(${CONFIG_EFUSE_CUSTOM_TABLE})
|
|
|
|
# Custom filename expands any path relative to the project
|
2018-12-06 09:49:02 +00:00
|
|
|
get_filename_component(EFUSE_CUSTOM_TABLE_CSV_PATH "${CONFIG_EFUSE_CUSTOM_TABLE_FILENAME}" ABSOLUTE BASE_DIR "${IDF_PROJECT_PATH}")
|
|
|
|
add_custom_target(efuse_custom_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_COMMON_TABLE_CSV_PATH} ${EFUSE_CUSTOM_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG})
|
|
|
|
else()
|
|
|
|
add_custom_target(efuse_custom_table COMMAND)
|
2018-11-21 08:09:36 +00:00
|
|
|
endif()#if(${CONFIG_EFUSE_CUSTOM_TABLE})
|
2018-11-19 03:46:21 +00:00
|
|
|
|
2018-12-06 09:49:02 +00:00
|
|
|
add_custom_target(show_efuse_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_COMMON_TABLE_CSV_PATH} ${EFUSE_CUSTOM_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG} "--info")
|
2018-11-19 03:46:21 +00:00
|
|
|
|
|
|
|
###################
|
|
|
|
# Generates files for unit test. This command is run manually.
|
|
|
|
set(EFUSE_TEST_TABLE_CSV_PATH "${COMPONENT_PATH}/test/esp_efuse_test_table.csv")
|
2018-11-21 08:09:36 +00:00
|
|
|
add_custom_target(efuse_test_table COMMAND "${PYTHON}" "${CMAKE_CURRENT_SOURCE_DIR}/efuse_table_gen.py" ${EFUSE_TEST_TABLE_CSV_PATH} ${GEN_EFUSE_TABLE_ARG})
|