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