2020-02-06 06:00:18 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2023-08-28 06:02:08 +00:00
|
|
|
if(${target} STREQUAL "linux")
|
2023-10-16 03:41:02 +00:00
|
|
|
idf_component_register(INCLUDE_DIRS include)
|
2023-08-28 06:02:08 +00:00
|
|
|
else()
|
2023-10-16 03:41:02 +00:00
|
|
|
set(srcs "src/esp_timer.c"
|
2024-01-23 18:10:20 +00:00
|
|
|
"src/esp_timer_init.c"
|
2023-10-16 03:41:02 +00:00
|
|
|
"src/ets_timer_legacy.c"
|
|
|
|
"src/system_time.c"
|
|
|
|
"src/esp_timer_impl_common.c")
|
2023-08-28 06:02:08 +00:00
|
|
|
|
2023-10-16 03:41:02 +00:00
|
|
|
if(CONFIG_ESP_TIMER_IMPL_TG0_LAC)
|
|
|
|
list(APPEND srcs "src/esp_timer_impl_lac.c")
|
|
|
|
elseif(CONFIG_ESP_TIMER_IMPL_SYSTIMER)
|
|
|
|
list(APPEND srcs "src/esp_timer_impl_systimer.c")
|
|
|
|
endif()
|
2020-02-06 06:00:18 +00:00
|
|
|
|
2023-10-16 03:41:02 +00:00
|
|
|
if(CONFIG_SOC_SYSTIMER_SUPPORT_ETM)
|
|
|
|
list(APPEND srcs "src/esp_timer_etm.c")
|
|
|
|
endif()
|
2023-08-28 06:02:08 +00:00
|
|
|
|
2023-10-16 03:41:02 +00:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS include
|
|
|
|
PRIV_INCLUDE_DIRS private_include)
|
2024-01-23 18:10:20 +00:00
|
|
|
|
|
|
|
# Forces the linker to include esp_timer_init.c
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_timer_init_include_func")
|
2023-08-28 06:02:08 +00:00
|
|
|
endif()
|