From 0e0914476c420e8f298359cc34e4ec661ac0a532 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Tue, 26 Jan 2021 11:41:19 +0800 Subject: [PATCH] esp_common: move freertos hooks --- components/esp_common/CMakeLists.txt | 3 +-- components/esp_pm/linker.lf | 7 ++----- components/esp_system/CMakeLists.txt | 3 ++- components/{esp_common/src => esp_system}/freertos_hooks.c | 0 .../include/esp_freertos_hooks.h | 3 +++ 5 files changed, 8 insertions(+), 8 deletions(-) rename components/{esp_common/src => esp_system}/freertos_hooks.c (100%) rename components/{esp_common => esp_system}/include/esp_freertos_hooks.h (99%) diff --git a/components/esp_common/CMakeLists.txt b/components/esp_common/CMakeLists.txt index 4bb2fcbb97..1edabc4ea6 100644 --- a/components/esp_common/CMakeLists.txt +++ b/components/esp_common/CMakeLists.txt @@ -10,8 +10,7 @@ if(BOOTLOADER_BUILD) else() # Regular app build list(APPEND srcs "src/esp_err.c" - "src/esp_err_to_name.c" - "src/freertos_hooks.c") + "src/esp_err_to_name.c") # Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here. idf_component_register(SRCS "${srcs}" diff --git a/components/esp_pm/linker.lf b/components/esp_pm/linker.lf index 7bb7d05089..f1fe2f4baa 100644 --- a/components/esp_pm/linker.lf +++ b/components/esp_pm/linker.lf @@ -7,11 +7,6 @@ entries: if PM_SLP_IRAM_OPT = y && IDF_TARGET_ESP32 = n: pm_impl:periph_inform_out_light_sleep_overhead (noflash) -[mapping:esp_common_pm] -archive: libesp_common.a -entries: - if PM_RTOS_IDLE_OPT = y: - freertos_hooks:esp_vApplicationIdleHook (noflash) [mapping:esp_hw_support_pm] archive: libesp_hw_support.a entries: @@ -21,6 +16,8 @@ entries: [mapping:esp_system_pm] archive: libesp_system.a entries: + if PM_RTOS_IDLE_OPT = y: + freertos_hooks:esp_vApplicationIdleHook (noflash) if PM_SLP_IRAM_OPT = y: sleep_modes:esp_light_sleep_start (noflash) sleep_modes:esp_sleep_enable_timer_wakeup (noflash) diff --git a/components/esp_system/CMakeLists.txt b/components/esp_system/CMakeLists.txt index 74a3fdb655..2b5ea50442 100644 --- a/components/esp_system/CMakeLists.txt +++ b/components/esp_system/CMakeLists.txt @@ -15,7 +15,8 @@ set(srcs "intr_alloc.c" "sleep_modes.c" "task_wdt.c" "int_wdt.c" - "stack_check.c") + "stack_check.c" + "freertos_hooks.c") if(NOT (${target} STREQUAL "esp32c3") ) list(APPEND srcs "dbg_stubs.c") diff --git a/components/esp_common/src/freertos_hooks.c b/components/esp_system/freertos_hooks.c similarity index 100% rename from components/esp_common/src/freertos_hooks.c rename to components/esp_system/freertos_hooks.c diff --git a/components/esp_common/include/esp_freertos_hooks.h b/components/esp_system/include/esp_freertos_hooks.h similarity index 99% rename from components/esp_common/include/esp_freertos_hooks.h rename to components/esp_system/include/esp_freertos_hooks.h index 47db07ce9d..290d580b1d 100644 --- a/components/esp_common/include/esp_freertos_hooks.h +++ b/components/esp_system/include/esp_freertos_hooks.h @@ -16,6 +16,9 @@ #define __ESP_FREERTOS_HOOKS_H__ #include + +#include "freertos/portmacro.h" + #include "esp_err.h" #ifdef __cplusplus