mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 21:24:32 +02:00
Merge branch 'bugfix/freertos_esp_timer_deps' into 'master'
esp_timer: remove from freertos public requirements See merge request espressif/esp-idf!17818
This commit is contained in:
@@ -51,6 +51,7 @@ idf_component_register(SRCS "${srcs}"
|
||||
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
|
||||
# Requires "driver" for GPTimer in "SEGGER_SYSVIEW_Config_FreeRTOS.c"
|
||||
PRIV_REQUIRES soc driver
|
||||
REQUIRES esp_timer
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
||||
# disable --coverage for this component, as it is used as transport
|
||||
|
@@ -1,3 +1,4 @@
|
||||
idf_component_register(SRC_DIRS . param_test touch_sensor_test adc_dma_test dac_dma_test
|
||||
PRIV_INCLUDE_DIRS include param_test/include touch_sensor_test/include
|
||||
PRIV_REQUIRES cmock test_utils driver nvs_flash esp_serial_slave_link infrared_tools esp_adc_cal)
|
||||
PRIV_REQUIRES cmock test_utils driver nvs_flash esp_serial_slave_link
|
||||
infrared_tools esp_adc_cal esp_timer)
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "soc/gpio_periph.h"
|
||||
#include "soc/io_mux_reg.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_timer.h"
|
||||
#include "driver/ledc.h"
|
||||
#include "hal/ledc_ll.h"
|
||||
#include "driver/gpio.h"
|
||||
|
@@ -10,6 +10,7 @@
|
||||
#include "test_utils.h"
|
||||
#include "param_test.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
#include "driver/spi_common.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "ccomp_timer.h"
|
||||
|
@@ -14,5 +14,5 @@ set(src_dirs "." "${dir}")
|
||||
|
||||
idf_component_register(SRC_DIRS "${src_dirs}"
|
||||
PRIV_INCLUDE_DIRS "." "${dir}/include" "../private_include" "../${target}/private_include"
|
||||
PRIV_REQUIRES cmock test_utils efuse bootloader_support
|
||||
PRIV_REQUIRES cmock test_utils efuse bootloader_support esp_timer
|
||||
)
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#include "esp_efuse_table.h"
|
||||
#include "esp_efuse_utility.h"
|
||||
#include "esp_efuse_test_table.h"
|
||||
#include "esp_timer.h"
|
||||
#include "bootloader_random.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS . ../private_include
|
||||
PRIV_REQUIRES cmock test_utils esp_event driver)
|
||||
PRIV_REQUIRES cmock test_utils esp_event driver esp_timer)
|
||||
|
@@ -21,7 +21,7 @@ if(NOT BOOTLOADER_BUILD)
|
||||
endif()
|
||||
|
||||
# [refactor-todo]: requires "driver" for GPIO and RTC (by sleep_gpio and sleep_modes)
|
||||
list(APPEND priv_requires driver)
|
||||
list(APPEND priv_requires driver esp_timer)
|
||||
|
||||
if(CONFIG_IDF_TARGET_ESP32 OR CONFIG_IDF_TARGET_ESP32S2)
|
||||
list(APPEND srcs "rtc_wdt.c")
|
||||
|
@@ -1,5 +1,5 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "${include_dirs}"
|
||||
PRIV_REQUIRES cmock test_utils esp_hw_support driver efuse)
|
||||
PRIV_REQUIRES cmock test_utils esp_hw_support driver efuse esp_timer)
|
||||
|
||||
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u ld_include_test_dport_xt_highint5")
|
||||
|
@@ -36,7 +36,7 @@ endif()
|
||||
# [refactor-todo]: requires "driver" component for periph_ctrl header file
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS "include" "${idf_target}/include"
|
||||
PRIV_REQUIRES nvs_flash driver efuse
|
||||
PRIV_REQUIRES nvs_flash driver efuse esp_timer
|
||||
LDFRAGMENTS "${ldfragments}"
|
||||
EMBED_FILES ${embed_files}
|
||||
)
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include "nvs.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_efuse.h"
|
||||
#include "esp_timer.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/portmacro.h"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
idf_component_register(SRCS "pm_locks.c" "pm_trace.c" "pm_impl.c"
|
||||
INCLUDE_DIRS include
|
||||
PRIV_REQUIRES esp_system driver
|
||||
PRIV_REQUIRES esp_system driver esp_timer
|
||||
LDFRAGMENTS linker.lf)
|
||||
|
@@ -1,2 +1,2 @@
|
||||
idf_component_register(SRC_DIRS .
|
||||
PRIV_REQUIRES unity esp_pm ulp driver)
|
||||
PRIV_REQUIRES unity esp_pm ulp driver esp_timer)
|
||||
|
@@ -6,6 +6,7 @@
|
||||
#include "unity.h"
|
||||
#include "esp_pm.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "esp_timer.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/semphr.h"
|
||||
|
@@ -36,7 +36,7 @@ else()
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS include
|
||||
PRIV_REQUIRES spi_flash
|
||||
PRIV_REQUIRES spi_flash esp_timer
|
||||
# [refactor-todo] requirements due to init code,
|
||||
# should be removable once using component init functions
|
||||
# link-time registration is used.
|
||||
|
@@ -1,6 +1,7 @@
|
||||
set(requires "unity"
|
||||
"test_utils"
|
||||
"driver")
|
||||
"driver"
|
||||
"esp_timer")
|
||||
|
||||
set(excludes "test_ipc_isr.c"
|
||||
"test_ipc_isr.S"
|
||||
|
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "../private_include"
|
||||
PRIV_REQUIRES cmock test_utils)
|
||||
PRIV_REQUIRES cmock test_utils esp_timer)
|
||||
|
@@ -16,7 +16,6 @@
|
||||
#include "freertos/queue.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/event_groups.h"
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "freertos/portmacro.h"
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "esp_types.h"
|
||||
@@ -28,6 +27,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_private/wifi_os_adapter.h"
|
||||
#include "esp_private/wifi.h"
|
||||
#include "esp_phy_init.h"
|
||||
@@ -42,7 +42,6 @@
|
||||
#include "esp_coexist_internal.h"
|
||||
#include "esp_coexist_adapter.h"
|
||||
#include "esp32/dport_access.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp32/rom/ets_sys.h"
|
||||
|
||||
|
@@ -16,7 +16,6 @@
|
||||
#include "freertos/queue.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/event_groups.h"
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "freertos/portmacro.h"
|
||||
#include "freertos/xtensa_api.h"
|
||||
#include "esp_types.h"
|
||||
@@ -28,6 +27,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "esp_event.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_private/wifi_os_adapter.h"
|
||||
#include "esp_private/wifi.h"
|
||||
#include "esp_phy_init.h"
|
||||
|
@@ -113,17 +113,10 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# esp_timer is required by FreeRTOS when we use esp_timer_get_time() to do profiling
|
||||
# [refactor-todo]: make this an optional requirement depending on CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
|
||||
# Note, many other components implicitly include esp_timer.h via freertos portmacro.h and some
|
||||
# components implicitly depend on esp_timer via freertos.
|
||||
set(required_components esp_timer)
|
||||
|
||||
idf_component_register(SRCS "${srcs}"
|
||||
INCLUDE_DIRS ${include_dirs}
|
||||
PRIV_INCLUDE_DIRS ${private_include_dirs}
|
||||
LDFRAGMENTS linker.lf
|
||||
REQUIRES ${required_components}
|
||||
PRIV_REQUIRES soc esp_pm)
|
||||
|
||||
idf_component_get_property(COMPONENT_DIR freertos COMPONENT_DIR)
|
||||
@@ -166,3 +159,9 @@ if(CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME)
|
||||
# [refactor-todo]: port.c esp_startup_start_app_common() calls esp_gdbstub_init()
|
||||
idf_component_optional_requires(PRIVATE esp_gdbstub)
|
||||
endif()
|
||||
|
||||
if(CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER)
|
||||
# [refactor-todo]: esp_timer is required by FreeRTOS when we use esp_timer_get_time() to do profiling
|
||||
# Introduce a port wrapper function to avoid including esp_timer.h into the public header
|
||||
idf_component_optional_requires(PUBLIC esp_timer)
|
||||
endif()
|
||||
|
@@ -382,7 +382,6 @@ portmacro.h. Therefore, we need to keep these headers around for now to allow th
|
||||
#include <stdarg.h>
|
||||
#include <xtensa/hal.h>
|
||||
#include "esp_attr.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_newlib.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@@ -392,6 +391,11 @@ portmacro.h. Therefore, we need to keep these headers around for now to allow th
|
||||
#include <xtensa/config/system.h>
|
||||
#include <xtensa/xtensa_api.h>
|
||||
|
||||
/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
|
||||
#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
|
||||
#include "esp_timer.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -47,7 +47,6 @@
|
||||
#include "esp_macros.h"
|
||||
#include "esp_attr.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_timer.h" /* required for FreeRTOS run time stats */
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_system.h" /* required by esp_get_...() functions in portable.h. [refactor-todo] Update portable.h */
|
||||
#include "esp_newlib.h"
|
||||
@@ -55,6 +54,11 @@
|
||||
/* [refactor-todo] These includes are not directly used in this file. They are kept into to prevent a breaking change. Remove these. */
|
||||
#include <limits.h>
|
||||
|
||||
/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
|
||||
#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
|
||||
#include "esp_timer.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@@ -76,7 +76,6 @@
|
||||
#include "esp_private/crosscore_int.h"
|
||||
#include "esp_macros.h"
|
||||
#include "esp_attr.h"
|
||||
#include "esp_timer.h" /* required for esp_timer_get_time. [refactor-todo] make this common between archs */
|
||||
#include "esp_newlib.h" /* required for esp_reent_init() in tasks.c */
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_rom_sys.h"
|
||||
@@ -88,6 +87,11 @@
|
||||
#include <xtensa/config/system.h>
|
||||
#include <xtensa/xtensa_api.h>
|
||||
|
||||
/* [refactor-todo] introduce a port wrapper function to avoid including esp_timer.h into the public header */
|
||||
#if CONFIG_FREERTOS_RUN_TIME_STATS_USING_ESP_TIMER
|
||||
#include "esp_timer.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@@ -7,4 +7,4 @@ idf_component_register(SRC_DIRS integration/event_groups
|
||||
performance
|
||||
port
|
||||
PRIV_INCLUDE_DIRS .
|
||||
PRIV_REQUIRES cmock test_utils esp_system driver)
|
||||
PRIV_REQUIRES cmock test_utils esp_system driver esp_timer)
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#endif
|
||||
#include "esp_freertos_hooks.h"
|
||||
#include "esp_rom_sys.h"
|
||||
#include "esp_timer.h"
|
||||
|
||||
/* Counter task counts a target variable forever */
|
||||
static void task_count(void *vp_counter)
|
||||
|
@@ -7,7 +7,7 @@ set(TEST_CRTS "crts/server_cert_chain.pem"
|
||||
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils mbedtls
|
||||
PRIV_REQUIRES cmock test_utils mbedtls esp_timer
|
||||
EMBED_TXTFILES ${TEST_CRTS})
|
||||
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils driver)
|
||||
PRIV_REQUIRES cmock test_utils driver esp_timer)
|
||||
|
@@ -5,4 +5,4 @@ set(sources "test_pthread.c"
|
||||
"test_pthread_rwlock.c")
|
||||
|
||||
idf_component_register(SRCS ${sources}
|
||||
PRIV_REQUIRES cmock test_utils pthread)
|
||||
PRIV_REQUIRES cmock test_utils pthread esp_timer)
|
||||
|
@@ -5,4 +5,5 @@ endif()
|
||||
idf_component_register(SRC_DIRS "."
|
||||
EXCLUDE_SRCS "${exclude_srcs}"
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils spi_flash bootloader_support app_update driver)
|
||||
PRIV_REQUIRES cmock test_utils spi_flash bootloader_support app_update
|
||||
driver esp_timer)
|
||||
|
@@ -4,5 +4,6 @@ if(IDF_TARGET STREQUAL "esp32s2")
|
||||
"touch_slider.c"
|
||||
"touch_matrix.c"
|
||||
INCLUDE_DIRS include
|
||||
REQUIRES driver)
|
||||
REQUIRES driver
|
||||
PRIV_REQUIRES esp_timer)
|
||||
endif()
|
||||
|
@@ -12,7 +12,6 @@
|
||||
#include "freertos/semphr.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "esp_intr_alloc.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_err.h"
|
||||
#include "esp_rom_gpio.h"
|
||||
#include "hal/usbh_hal.h"
|
||||
|
@@ -5,7 +5,7 @@ idf_component_register(SRCS "vfs.c"
|
||||
"vfs_console.c"
|
||||
INCLUDE_DIRS include
|
||||
PRIV_INCLUDE_DIRS private_include
|
||||
PRIV_REQUIRES driver)
|
||||
PRIV_REQUIRES driver esp_timer)
|
||||
|
||||
if(CONFIG_ESP_CONSOLE_USB_CDC)
|
||||
target_sources(${COMPONENT_LIB} PRIVATE "vfs_cdcacm.c")
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "drivers/driver.h"
|
||||
#include "common/ieee802_11_defs.h"
|
||||
#include "esp_timer.h"
|
||||
/*
|
||||
* struct rrm_data - Data used for managing RRM features
|
||||
*/
|
||||
|
@@ -11,7 +11,19 @@ Update fragment file grammar
|
||||
|
||||
Please follow the :ref:`migrate linker script fragment files grammar<ldgen-migrate-lf-grammar>` chapter for migrating v3.x grammar to the new one.
|
||||
|
||||
Component dependencies that shall be explicit
|
||||
---------------------------------------------
|
||||
Specify component requirements explicitly
|
||||
-----------------------------------------
|
||||
|
||||
In previous versions of ESP-IDF, target components (``components/esp32*``) had a dependency on ``driver`` and ``efuse`` components. Since target components were part of common requirements (:ref:`more info about common requirements <component-common-requirements>`), all components in the project implicitly had a dependency on ``driver`` and ``efuse``. Now that the dependency of target components on these components has been removed, every component depending on ``driver`` or ``efuse`` has to declare this dependency explicitly. This can be done by adding ``REQUIRES <component_name>`` or ``PRIV_REQUIRES <component_name>`` in ``idf_component_register`` call inside component's ``CMakeLists.txt``. See :ref:`Component Requirements` for more information on specifying requirements.
|
||||
In previous versions of ESP-IDF, some components were always added as public requirements (dependencies) to every component in the build, in addition to the :ref:`common requirements<component-common-requirements>`:
|
||||
|
||||
* ``driver``
|
||||
* ``efuse``
|
||||
* ``esp_timer``
|
||||
|
||||
This means that it was possible to include header files of those components without specifying them as requirements in ``idf_component_register``.
|
||||
|
||||
This behavior was caused by transitive dependencies of various common components.
|
||||
|
||||
In ESP-IDF v5.0, this behavior is fixed and these components are no longer added as public requirements by default.
|
||||
|
||||
Every component depending on one of the components which isn't part of common requirements has to declare this dependency explicitly. This can be done by adding ``REQUIRES <component_name>`` or ``PRIV_REQUIRES <component_name>`` in ``idf_component_register`` call inside component's ``CMakeLists.txt``. See :ref:`Component Requirements` for more information on specifying requirements.
|
||||
|
@@ -8,6 +8,7 @@
|
||||
#include "freertos/task.h"
|
||||
#include "freertos/queue.h"
|
||||
#include "freertos/FreeRTOSConfig.h"
|
||||
#include "esp_timer.h"
|
||||
|
||||
#include "esp_ble_mesh_networking_api.h"
|
||||
#include "ble_mesh_adapter.h"
|
||||
|
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
#include "esp_bt.h"
|
||||
#include "esp_timer.h"
|
||||
#include "soc/soc.h"
|
||||
|
||||
#include "test.h"
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "esp_bt.h"
|
||||
#include "esp_timer.h"
|
||||
|
||||
#include "esp_ble_mesh_defs.h"
|
||||
#include "esp_ble_mesh_common_api.h"
|
||||
|
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRCS "button.c" "button_obj.cpp"
|
||||
INCLUDE_DIRS "." "include"
|
||||
PRIV_REQUIRES driver)
|
||||
PRIV_REQUIRES driver esp_timer)
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include "freertos/task.h"
|
||||
#include "esp_bt.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "freertos/queue.h"
|
||||
#include "bt_hci_common.h"
|
||||
|
@@ -1,3 +1,4 @@
|
||||
idf_component_register(SRCS "iperf.c"
|
||||
INCLUDE_DIRS "include"
|
||||
REQUIRES lwip)
|
||||
REQUIRES lwip
|
||||
PRIV_REQUIRES esp_timer)
|
||||
|
@@ -24,6 +24,7 @@
|
||||
#include "esp_event.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_timer.h"
|
||||
#include "nvs_flash.h"
|
||||
#include "nvs.h"
|
||||
#include "protocol_examples_common.h"
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include "esp_vfs.h"
|
||||
#include "esp_vfs_dev.h"
|
||||
#include "esp_vfs_eventfd.h"
|
||||
#include "esp_timer.h"
|
||||
#include "driver/gptimer.h"
|
||||
|
||||
#define TIMER_RESOLUTION 1000000 // 1MHz, 1 tick = 1us
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include "driver/uart.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_timer.h"
|
||||
#include "light_sleep_example.h"
|
||||
|
||||
static void light_sleep_task(void *args)
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include "freertos/task.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_spi_flash.h"
|
||||
#include "esp_timer.h"
|
||||
#include <esp_task.h>
|
||||
|
||||
#include <setjmp.h>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
idf_component_register(SRC_DIRS "."
|
||||
PRIV_INCLUDE_DIRS "."
|
||||
PRIV_REQUIRES cmock test_utils perfmon)
|
||||
PRIV_REQUIRES cmock test_utils perfmon esp_timer)
|
||||
|
Reference in New Issue
Block a user