2019-08-08 05:33:45 +00:00
|
|
|
if(BOOTLOADER_BUILD)
|
|
|
|
# bootloader only needs FreeRTOS for config, not for anything else
|
|
|
|
idf_component_register()
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2020-11-06 04:03:21 +00:00
|
|
|
idf_build_get_property(target IDF_TARGET)
|
|
|
|
|
2021-08-04 12:33:44 +00:00
|
|
|
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
2020-11-06 04:03:21 +00:00
|
|
|
set(srcs
|
|
|
|
"port/xtensa/port.c"
|
|
|
|
"port/xtensa/portasm.S"
|
|
|
|
"port/xtensa/xtensa_context.S"
|
|
|
|
"port/xtensa/xtensa_init.c"
|
|
|
|
"port/xtensa/xtensa_overlay_os_hook.c"
|
|
|
|
"port/xtensa/xtensa_vector_defaults.S"
|
|
|
|
"port/xtensa/xtensa_vectors.S")
|
|
|
|
|
|
|
|
set(include_dirs
|
|
|
|
include
|
2021-09-08 08:53:57 +00:00
|
|
|
include/esp_additions/freertos # For files with #include "FreeRTOSConfig.h"
|
|
|
|
port/xtensa/include # For including arch-specific FreeRTOSConfig_arch.h in port/<arch>/include
|
|
|
|
include/esp_additions) # For files with #include "freertos/FreeRTOSConfig.h"
|
2020-11-06 04:03:21 +00:00
|
|
|
|
|
|
|
set(private_include_dirs
|
|
|
|
port/xtensa/include/freertos
|
|
|
|
port/xtensa
|
2021-08-04 12:33:44 +00:00
|
|
|
port/priv_include
|
2020-11-06 04:03:21 +00:00
|
|
|
.)
|
|
|
|
|
2021-08-04 12:33:44 +00:00
|
|
|
elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
|
2020-11-06 04:03:21 +00:00
|
|
|
set(srcs
|
|
|
|
"port/riscv/port.c"
|
|
|
|
"port/riscv/portasm.S")
|
|
|
|
|
|
|
|
set(include_dirs
|
|
|
|
include
|
2021-09-08 08:53:57 +00:00
|
|
|
include/esp_additions/freertos # For files with #include "FreeRTOSConfig.h"
|
|
|
|
port/riscv/include # For including arch-specific FreeRTOSConfig_arch.h in port/<arch>/include
|
|
|
|
include/esp_additions) # For files with #include "freertos/FreeRTOSConfig.h"
|
2020-11-06 04:03:21 +00:00
|
|
|
|
|
|
|
set(private_include_dirs
|
|
|
|
port/riscv/include/freertos
|
|
|
|
port/riscv
|
2021-08-04 12:33:44 +00:00
|
|
|
port/priv_include
|
2020-11-06 04:03:21 +00:00
|
|
|
.)
|
|
|
|
|
|
|
|
endif()
|
2020-01-17 14:44:13 +00:00
|
|
|
|
2020-11-10 07:40:01 +00:00
|
|
|
list(APPEND srcs
|
2021-08-04 02:56:37 +00:00
|
|
|
"esp_additions/task_snapshot.c"
|
2020-11-06 04:03:21 +00:00
|
|
|
"port/port_common.c"
|
2021-08-04 12:33:44 +00:00
|
|
|
"port/port_systick.c"
|
2019-06-21 06:29:32 +00:00
|
|
|
"croutine.c"
|
|
|
|
"event_groups.c"
|
|
|
|
"list.c"
|
|
|
|
"queue.c"
|
|
|
|
"tasks.c"
|
2019-11-28 18:27:47 +00:00
|
|
|
"timers.c"
|
|
|
|
"stream_buffer.c"
|
2020-11-09 10:08:29 +00:00
|
|
|
"FreeRTOS-openocd.c"
|
|
|
|
"freertos_v8_compat.c")
|
2020-01-17 14:44:13 +00:00
|
|
|
|
2021-08-04 02:56:37 +00:00
|
|
|
list(APPEND private_include_dirs
|
|
|
|
"include/freertos")
|
|
|
|
|
2020-02-26 12:21:59 +00:00
|
|
|
if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
2020-11-06 04:03:21 +00:00
|
|
|
list(APPEND srcs "port/xtensa/xtensa_loadstore_handler.S")
|
|
|
|
endif()
|
2020-02-26 12:21:59 +00:00
|
|
|
|
2021-08-04 12:33:44 +00:00
|
|
|
# esp_timer is required by FreeRTOS because we use esp_tiemr_get_time() to do profiling
|
2020-12-21 17:17:42 +00:00
|
|
|
# app_trace is required by FreeRTOS headers only when CONFIG_APPTRACE_SV_ENABLE=y,
|
2021-08-04 12:33:44 +00:00
|
|
|
# REQUIRES can't depend on config options, so always require it.
|
|
|
|
set(required_components app_trace esp_timer)
|
|
|
|
|
2019-04-28 07:38:23 +00:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2020-01-17 14:44:13 +00:00
|
|
|
INCLUDE_DIRS ${include_dirs}
|
2020-11-10 07:40:01 +00:00
|
|
|
PRIV_INCLUDE_DIRS ${private_include_dirs}
|
2019-04-28 07:38:23 +00:00
|
|
|
LDFRAGMENTS linker.lf
|
2020-11-06 04:03:21 +00:00
|
|
|
REQUIRES ${required_components}
|
2021-03-19 12:03:13 +00:00
|
|
|
PRIV_REQUIRES soc esp_pm)
|
2020-11-10 07:40:01 +00:00
|
|
|
|
2019-12-02 06:41:33 +00:00
|
|
|
idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
|
|
|
|
idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/include/freertos/")
|
2018-01-12 02:49:13 +00:00
|
|
|
|
2019-10-16 12:23:05 +00:00
|
|
|
if(CONFIG_FREERTOS_DEBUG_OCDAWARE)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=uxTopUsedPriority")
|
|
|
|
endif()
|
2018-08-16 05:01:43 +00:00
|
|
|
|
|
|
|
set_source_files_properties(
|
|
|
|
tasks.c
|
|
|
|
event_groups.c
|
|
|
|
timers.c
|
|
|
|
queue.c
|
2019-11-28 18:27:47 +00:00
|
|
|
stream_buffer.c
|
2018-08-16 05:01:43 +00:00
|
|
|
PROPERTIES COMPILE_DEFINITIONS
|
|
|
|
_ESP_FREERTOS_INTERNAL
|
|
|
|
)
|
2020-02-05 14:40:15 +00:00
|
|
|
|
2020-11-10 07:40:01 +00:00
|
|
|
# The freertos component provides the `start_app` and `start_app_other_cores`
|
|
|
|
# if it is included in the build. It then calls `app_main`
|
|
|
|
# from the main task created, which must be provided by the user.
|
2020-06-10 13:13:31 +00:00
|
|
|
# Like for `start_app` and `start_app_other_cores`,
|
|
|
|
# we can't establish dependency on what we don't yet know, so we force the
|
|
|
|
# linker to not drop this symbol.
|
2020-11-10 07:40:01 +00:00
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u app_main")
|