2019-08-08 01:33:45 -04:00
|
|
|
if(BOOTLOADER_BUILD)
|
|
|
|
# bootloader only needs FreeRTOS for config, not for anything else
|
|
|
|
idf_component_register()
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(srcs
|
2020-01-17 09:44:13 -05:00
|
|
|
"xtensa/port.c"
|
|
|
|
"xtensa/portasm.S"
|
|
|
|
"xtensa/xtensa_context.S"
|
|
|
|
"xtensa/xtensa_init.c"
|
|
|
|
"xtensa/xtensa_overlay_os_hook.c"
|
|
|
|
"xtensa/xtensa_vector_defaults.S"
|
|
|
|
"xtensa/xtensa_vectors.S")
|
|
|
|
|
|
|
|
list(APPEND srcs
|
2019-06-21 02:29:32 -04:00
|
|
|
"croutine.c"
|
|
|
|
"event_groups.c"
|
|
|
|
"list.c"
|
|
|
|
"queue.c"
|
|
|
|
"tasks.c"
|
2019-11-28 13:27:47 -05:00
|
|
|
"timers.c"
|
|
|
|
"stream_buffer.c"
|
|
|
|
"FreeRTOS-openocd.c")
|
2020-01-17 09:44:13 -05:00
|
|
|
|
|
|
|
set(include_dirs
|
|
|
|
include
|
|
|
|
xtensa/include)
|
|
|
|
|
|
|
|
set(private_include_dirs
|
|
|
|
include/freertos
|
|
|
|
xtensa/include/freertos
|
|
|
|
xtensa
|
|
|
|
.)
|
2019-06-21 02:29:32 -04:00
|
|
|
|
2020-02-26 07:21:59 -05:00
|
|
|
if(CONFIG_ESP32_IRAM_AS_8BIT_ACCESSIBLE_MEMORY)
|
|
|
|
list(APPEND srcs "xtensa/xtensa_loadstore_handler.S")
|
|
|
|
endif()
|
|
|
|
|
2018-09-21 02:58:34 -04:00
|
|
|
# app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y,
|
|
|
|
# but requirements can't depend on config options, so always require it.
|
2019-04-28 03:38:23 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2020-01-17 09:44:13 -05:00
|
|
|
INCLUDE_DIRS ${include_dirs}
|
|
|
|
PRIV_INCLUDE_DIRS ${private_include_dirs}
|
2019-04-28 03:38:23 -04:00
|
|
|
LDFRAGMENTS linker.lf
|
2020-02-06 01:00:18 -05:00
|
|
|
REQUIRES app_trace esp_timer
|
2019-04-28 03:38:23 -04:00
|
|
|
PRIV_REQUIRES soc)
|
2019-12-02 01:41:33 -05:00
|
|
|
|
|
|
|
idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
|
|
|
|
idf_component_set_property(freertos ORIG_INCLUDE_PATH "${COMPONENT_DIR}/include/freertos/")
|
2018-01-11 21:49:13 -05:00
|
|
|
|
2019-10-16 08:23:05 -04:00
|
|
|
if(CONFIG_FREERTOS_DEBUG_OCDAWARE)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--undefined=uxTopUsedPriority")
|
|
|
|
endif()
|
2018-08-16 01:01:43 -04:00
|
|
|
|
|
|
|
set_source_files_properties(
|
|
|
|
tasks.c
|
|
|
|
event_groups.c
|
|
|
|
timers.c
|
|
|
|
queue.c
|
2019-11-28 13:27:47 -05:00
|
|
|
stream_buffer.c
|
2018-08-16 01:01:43 -04:00
|
|
|
PROPERTIES COMPILE_DEFINITIONS
|
|
|
|
_ESP_FREERTOS_INTERNAL
|
|
|
|
)
|
2020-02-05 09:40:15 -05:00
|
|
|
|
2020-06-10 09:13:31 -04: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.
|
|
|
|
# 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.
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u app_main")
|