2020-09-18 17:23:28 +08:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2022-04-16 08:02:57 +02:00
|
|
|
set(requires soc)
|
2022-11-23 00:39:25 +08:00
|
|
|
# only esp_hw_support/adc_share_hw_ctrl.c requires efuse component
|
2022-04-16 08:02:57 +02:00
|
|
|
set(priv_requires efuse spi_flash bootloader_support)
|
2020-09-18 17:23:28 +08:00
|
|
|
|
2022-07-21 19:14:41 +08:00
|
|
|
set(srcs "cpu.c" "esp_memory_utils.c")
|
2020-11-23 15:35:09 +08:00
|
|
|
if(NOT BOOTLOADER_BUILD)
|
2022-06-28 11:06:27 +08:00
|
|
|
list(APPEND srcs "esp_clk.c"
|
2021-03-10 21:39:29 +08:00
|
|
|
"clk_ctrl_os.c"
|
|
|
|
"hw_random.c"
|
|
|
|
"intr_alloc.c"
|
2021-03-10 21:55:49 +08:00
|
|
|
"mac_addr.c"
|
2022-03-24 21:33:36 +08:00
|
|
|
"periph_ctrl.c"
|
2022-04-29 13:40:23 +08:00
|
|
|
"rtc_module.c"
|
2021-03-30 14:50:27 +08:00
|
|
|
"sleep_modes.c"
|
2021-08-19 21:57:17 +08:00
|
|
|
"sleep_gpio.c"
|
2021-08-20 10:15:48 +08:00
|
|
|
"sleep_mac_bb.c"
|
2022-07-21 11:47:09 +08:00
|
|
|
"regi2c_ctrl.c"
|
|
|
|
"adc_share_hw_ctrl.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
|
2021-08-20 15:15:58 +08:00
|
|
|
if(NOT CONFIG_IDF_TARGET_ESP32 AND NOT CONFIG_IDF_TARGET_ESP32S2)
|
|
|
|
list(APPEND srcs "sleep_retention.c")
|
|
|
|
endif()
|
2022-01-28 19:47:04 +08:00
|
|
|
|
|
|
|
# [refactor-todo]: requires "driver" for GPIO and RTC (by sleep_gpio and sleep_modes)
|
2022-04-16 11:32:22 +02:00
|
|
|
list(APPEND priv_requires driver esp_timer)
|
2022-01-28 19:47:04 +08:00
|
|
|
|
2022-02-28 18:30:36 +08:00
|
|
|
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
|
2022-01-18 17:34:15 +08:00
|
|
|
list(APPEND srcs "rtc_wdt.c")
|
|
|
|
endif()
|
|
|
|
|
2022-06-28 11:06:27 +08:00
|
|
|
if(CONFIG_SOC_GDMA_SUPPORTED)
|
2022-09-13 18:47:08 +08:00
|
|
|
list(APPEND srcs "dma/gdma.c" "dma/async_memcpy_impl_gdma.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_CP_DMA_SUPPORTED)
|
2022-09-13 18:47:08 +08:00
|
|
|
list(APPEND srcs "dma/async_memcpy_impl_cp_dma.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_GDMA_SUPPORTED OR CONFIG_SOC_CP_DMA_SUPPORTED)
|
2022-09-13 18:47:08 +08:00
|
|
|
list(APPEND srcs "dma/esp_async_memcpy.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_SOC_GDMA_SUPPORT_ETM)
|
|
|
|
list(APPEND srcs "dma/gdma_etm.c")
|
2022-06-28 11:06:27 +08:00
|
|
|
endif()
|
|
|
|
|
2022-07-25 11:23:39 +08:00
|
|
|
if(CONFIG_SOC_SYSTIMER_SUPPORTED)
|
|
|
|
list(APPEND srcs "port/${target}/systimer.c")
|
|
|
|
endif()
|
|
|
|
|
2022-10-03 19:46:59 +05:30
|
|
|
if(CONFIG_SOC_HMAC_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_hmac.c")
|
|
|
|
endif()
|
|
|
|
|
2022-07-12 14:44:10 +08:00
|
|
|
if(CONFIG_SOC_ETM_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_etm.c")
|
|
|
|
endif()
|
|
|
|
|
2022-11-04 11:47:47 +05:30
|
|
|
if(CONFIG_SOC_DIG_SIGN_SUPPORTED)
|
|
|
|
list(APPEND srcs "esp_ds.c")
|
|
|
|
endif()
|
|
|
|
|
2022-07-12 19:46:23 +08:00
|
|
|
# ESP32C6-TODO
|
|
|
|
if(CONFIG_IDF_TARGET_ESP32C6)
|
|
|
|
list(REMOVE_ITEM srcs
|
|
|
|
"adc_share_hw_ctrl.c" # TODO: IDF-5312
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2021-02-07 15:03:51 +08:00
|
|
|
else()
|
|
|
|
# Requires "_esp_error_check_failed()" function
|
|
|
|
list(APPEND priv_requires "esp_system")
|
2021-02-18 21:09:27 +08:00
|
|
|
endif()
|
|
|
|
|
2020-11-23 15:35:09 +08:00
|
|
|
idf_component_register(SRCS ${srcs}
|
2021-03-03 18:21:07 +08:00
|
|
|
INCLUDE_DIRS include include/soc include/soc/${target}
|
2022-01-05 06:08:37 +00:00
|
|
|
PRIV_INCLUDE_DIRS port/include include/esp_private
|
2020-09-18 17:23:28 +08:00
|
|
|
REQUIRES ${requires}
|
2021-03-19 20:03:13 +08:00
|
|
|
PRIV_REQUIRES "${priv_requires}"
|
2020-09-25 15:23:52 +08:00
|
|
|
LDFRAGMENTS linker.lf)
|
|
|
|
|
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
add_subdirectory(port/${target})
|
2021-03-19 15:54:30 +08:00
|
|
|
|
2022-05-11 10:32:56 +08:00
|
|
|
if(NOT BOOTLOADER_BUILD)
|
|
|
|
if(CONFIG_SPIRAM)
|
|
|
|
idf_component_optional_requires(PRIVATE esp_psram)
|
2021-03-19 15:54:30 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2022-01-31 19:45:31 +01:00
|
|
|
|
|
|
|
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
|