move common source files from esp32 to esp_common
This commit is contained in:
parent
80dd3ae749
commit
fcedf442ce
27 changed files with 56 additions and 35 deletions
|
@ -16,15 +16,11 @@ else()
|
||||||
"coexist.c"
|
"coexist.c"
|
||||||
"cpu_start.c"
|
"cpu_start.c"
|
||||||
"crosscore_int.c"
|
"crosscore_int.c"
|
||||||
"dbg_stubs.c"
|
|
||||||
"dport_access.c"
|
"dport_access.c"
|
||||||
"dport_panic_highint_hdl.S"
|
"dport_panic_highint_hdl.S"
|
||||||
"esp_adapter.c"
|
"esp_adapter.c"
|
||||||
"esp_err_to_name.c"
|
|
||||||
"esp_timer.c"
|
|
||||||
"esp_timer_esp32.c"
|
"esp_timer_esp32.c"
|
||||||
"esp_himem.c"
|
"esp_himem.c"
|
||||||
"ets_timer_legacy.c"
|
|
||||||
"fast_crypto_ops.c"
|
"fast_crypto_ops.c"
|
||||||
"freertos_hooks.c"
|
"freertos_hooks.c"
|
||||||
"gdbstub.c"
|
"gdbstub.c"
|
||||||
|
@ -36,14 +32,12 @@ else()
|
||||||
"panic.c"
|
"panic.c"
|
||||||
"phy_init.c"
|
"phy_init.c"
|
||||||
"pm_esp32.c"
|
"pm_esp32.c"
|
||||||
"pm_locks.c"
|
|
||||||
"pm_trace.c"
|
"pm_trace.c"
|
||||||
"reset_reason.c"
|
"reset_reason.c"
|
||||||
"restore.c"
|
"restore.c"
|
||||||
"sleep_modes.c"
|
"sleep_modes.c"
|
||||||
"spiram.c"
|
"spiram.c"
|
||||||
"spiram_psram.c"
|
"spiram_psram.c"
|
||||||
"stack_check.c"
|
|
||||||
"system_api.c"
|
"system_api.c"
|
||||||
"task_wdt.c"
|
"task_wdt.c"
|
||||||
"wifi_init.c"
|
"wifi_init.c"
|
||||||
|
@ -56,7 +50,7 @@ else()
|
||||||
# app_update is added here because cpu_start.c uses esp_ota_get_app_description() function.
|
# app_update is added here because cpu_start.c uses esp_ota_get_app_description() function.
|
||||||
set(COMPONENT_PRIV_REQUIRES
|
set(COMPONENT_PRIV_REQUIRES
|
||||||
app_trace app_update bootloader_support log mbedtls nvs_flash
|
app_trace app_update bootloader_support log mbedtls nvs_flash
|
||||||
pthread smartconfig_ack spi_flash vfs wpa_supplicant xtensa-debug-module espcoredump)
|
pthread smartconfig_ack spi_flash vfs wpa_supplicant xtensa-debug-module espcoredump esp_common)
|
||||||
|
|
||||||
set(COMPONENT_ADD_LDFRAGMENTS linker.lf ld/esp32_fragments.lf)
|
set(COMPONENT_ADD_LDFRAGMENTS linker.lf ld/esp32_fragments.lf)
|
||||||
|
|
||||||
|
@ -134,7 +128,7 @@ else()
|
||||||
|
|
||||||
# disable stack protection in files which are involved in initialization of that feature
|
# disable stack protection in files which are involved in initialization of that feature
|
||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
stack_check.c cpu_start.c
|
cpu_start.c
|
||||||
PROPERTIES COMPILE_FLAGS
|
PROPERTIES COMPILE_FLAGS
|
||||||
-fno-stack-protector)
|
-fno-stack-protector)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include "soc/cpu.h"
|
#include "soc/cpu.h"
|
||||||
#include "soc/rtc_cntl_reg.h"
|
#include "soc/rtc_cntl_reg.h"
|
||||||
#include "esp32/rom/ets_sys.h"
|
#include "esp32/rom/ets_sys.h"
|
||||||
#include "esp_system_internal.h"
|
#include "esp_private/system_internal.h"
|
||||||
#include "driver/rtc_cntl.h"
|
#include "driver/rtc_cntl.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
|
|
||||||
|
|
|
@ -53,5 +53,4 @@ esp32_out.ld: $(COMPONENT_PATH)/ld/esp32.ld ../include/sdkconfig.h
|
||||||
COMPONENT_EXTRA_CLEAN := esp32_out.ld $(COMPONENT_BUILD_DIR)/esp32.project.ld
|
COMPONENT_EXTRA_CLEAN := esp32_out.ld $(COMPONENT_BUILD_DIR)/esp32.project.ld
|
||||||
|
|
||||||
# disable stack protection in files which are involved in initialization of that feature
|
# disable stack protection in files which are involved in initialization of that feature
|
||||||
stack_check.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
|
|
||||||
cpu_start.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
|
cpu_start.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
#include "esp_clk_internal.h"
|
#include "esp_clk_internal.h"
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
#include "esp_pm.h"
|
#include "esp_pm.h"
|
||||||
#include "pm_impl.h"
|
#include "esp_private/pm_impl.h"
|
||||||
#include "trax.h"
|
#include "trax.h"
|
||||||
#include "esp_ota_ops.h"
|
#include "esp_ota_ops.h"
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include "esp_intr_alloc.h"
|
#include "esp_intr_alloc.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp32/clk.h"
|
#include "esp32/clk.h"
|
||||||
#include "esp_timer_impl.h"
|
#include "esp_private/esp_timer_impl.h"
|
||||||
#include "soc/frc_timer_reg.h"
|
#include "soc/frc_timer_reg.h"
|
||||||
#include "soc/rtc.h"
|
#include "soc/rtc.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp_pm.h"
|
#include "esp_pm.h"
|
||||||
#include "pm_impl.h"
|
#include "esp_private/pm_impl.h"
|
||||||
|
|
||||||
//We use just a static array here because it's not expected many components will need
|
//We use just a static array here because it's not expected many components will need
|
||||||
//an idle or tick hook.
|
//an idle or tick hook.
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#include "esp_spi_flash.h"
|
#include "esp_spi_flash.h"
|
||||||
#include "esp32/cache_err_int.h"
|
#include "esp32/cache_err_int.h"
|
||||||
#include "esp_app_trace.h"
|
#include "esp_app_trace.h"
|
||||||
#include "esp_system_internal.h"
|
#include "esp_private/system_internal.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp_ota_ops.h"
|
#include "esp_ota_ops.h"
|
||||||
#if CONFIG_SYSVIEW_ENABLE
|
#if CONFIG_SYSVIEW_ENABLE
|
||||||
|
|
|
@ -31,9 +31,9 @@
|
||||||
#include "freertos/xtensa_timer.h"
|
#include "freertos/xtensa_timer.h"
|
||||||
#include "xtensa/core-macros.h"
|
#include "xtensa/core-macros.h"
|
||||||
|
|
||||||
#include "pm_impl.h"
|
#include "esp_private/pm_impl.h"
|
||||||
#include "pm_trace.h"
|
#include "esp_private/pm_trace.h"
|
||||||
#include "esp_timer_impl.h"
|
#include "esp_private/esp_timer_impl.h"
|
||||||
#include "esp32/pm.h"
|
#include "esp32/pm.h"
|
||||||
|
|
||||||
/* CCOMPARE update timeout, in CPU cycles. Any value above ~600 cycles will work
|
/* CCOMPARE update timeout, in CPU cycles. Any value above ~600 cycles will work
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#include "pm_trace.h"
|
#include "esp_private/pm_trace.h"
|
||||||
#include "driver/gpio.h"
|
#include "driver/gpio.h"
|
||||||
#include "soc/gpio_reg.h"
|
#include "soc/gpio_reg.h"
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "esp_system_internal.h"
|
|
||||||
#include "esp32/rom/rtc.h"
|
#include "esp32/rom/rtc.h"
|
||||||
|
#include "esp_private/system_internal.h"
|
||||||
#include "soc/rtc_cntl_reg.h"
|
#include "soc/rtc_cntl_reg.h"
|
||||||
|
|
||||||
static void esp_reset_reason_clear_hint();
|
static void esp_reset_reason_clear_hint();
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include "esp_attr.h"
|
#include "esp_attr.h"
|
||||||
#include "esp_sleep.h"
|
#include "esp_sleep.h"
|
||||||
#include "esp_timer_impl.h"
|
#include "esp_private/esp_timer_impl.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp32/clk.h"
|
#include "esp32/clk.h"
|
||||||
#include "esp_newlib.h"
|
#include "esp_newlib.h"
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/xtensa_api.h"
|
#include "freertos/xtensa_api.h"
|
||||||
#include "esp_heap_caps.h"
|
#include "esp_heap_caps.h"
|
||||||
#include "esp_system_internal.h"
|
#include "esp_private/system_internal.h"
|
||||||
#include "esp_efuse.h"
|
#include "esp_efuse.h"
|
||||||
#include "esp_efuse_table.h"
|
#include "esp_efuse_table.h"
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include "driver/timer.h"
|
#include "driver/timer.h"
|
||||||
#include "driver/periph_ctrl.h"
|
#include "driver/periph_ctrl.h"
|
||||||
#include "esp_task_wdt.h"
|
#include "esp_task_wdt.h"
|
||||||
#include "esp_system_internal.h"
|
#include "esp_private/system_internal.h"
|
||||||
|
|
||||||
static const char *TAG = "task_wdt";
|
static const char *TAG = "task_wdt";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
set(COMPONENT_SRCDIRS ".")
|
set(COMPONENT_SRCDIRS ".")
|
||||||
set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
|
set(COMPONENT_ADD_INCLUDEDIRS ". ${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
|
|
||||||
set(COMPONENT_REQUIRES unity test_utils nvs_flash ulp)
|
set(COMPONENT_REQUIRES unity test_utils nvs_flash ulp esp_common)
|
||||||
|
|
||||||
register_component()
|
register_component()
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
#include "freertos/semphr.h"
|
#include "freertos/semphr.h"
|
||||||
#include "test_utils.h"
|
#include "test_utils.h"
|
||||||
#include "../esp_timer_impl.h"
|
#include "esp_private/esp_timer_impl.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ESP_TIMER_PROFILING
|
#ifdef CONFIG_ESP_TIMER_PROFILING
|
||||||
#define WITH_PROFILING 1
|
#define WITH_PROFILING 1
|
||||||
|
|
19
components/esp_common/CMakeLists.txt
Normal file
19
components/esp_common/CMakeLists.txt
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
set(COMPONENT_SRCS
|
||||||
|
"src/dbg_stubs.c"
|
||||||
|
"src/esp_err_to_name.c"
|
||||||
|
"src/esp_timer.c"
|
||||||
|
"src/ets_timer_legacy.c"
|
||||||
|
"src/pm_locks.c"
|
||||||
|
"src/stack_check.c")
|
||||||
|
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
||||||
|
set(COMPONENT_PRIV_INCLUDEDIRS)
|
||||||
|
set(COMPONENT_REQUIRES)
|
||||||
|
# dbg_stubs.c needs eri.h from xtensa-debug-module
|
||||||
|
set(COMPONENT_PRIV_REQUIRES "xtensa-debug-module")
|
||||||
|
register_component()
|
||||||
|
|
||||||
|
set_source_files_properties(
|
||||||
|
"src/stack_check.c"
|
||||||
|
PROPERTIES COMPILE_FLAGS
|
||||||
|
-fno-stack-protector)
|
||||||
|
|
9
components/esp_common/component.mk
Normal file
9
components/esp_common/component.mk
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#
|
||||||
|
# Component Makefile
|
||||||
|
#
|
||||||
|
|
||||||
|
COMPONENT_ADD_INCLUDEDIRS := include
|
||||||
|
COMPONENT_SRCDIRS := src
|
||||||
|
|
||||||
|
# disable stack protection in files which are involved in initialization of that feature
|
||||||
|
stack_check.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
|
|
@ -15,7 +15,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file esp_timer_impl.h
|
* @file esp_private/esp_timer_impl.h
|
||||||
*
|
*
|
||||||
* @brief Interface between common and platform-specific parts of esp_timer.
|
* @brief Interface between common and platform-specific parts of esp_timer.
|
||||||
*
|
*
|
|
@ -15,7 +15,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file pm_impl.h
|
* @file esp_private/pm_impl.h
|
||||||
*
|
*
|
||||||
* This header file defines interface between PM lock functions (pm_locks.c)
|
* This header file defines interface between PM lock functions (pm_locks.c)
|
||||||
* and the chip-specific power management (DFS/light sleep) implementation.
|
* and the chip-specific power management (DFS/light sleep) implementation.
|
|
@ -26,7 +26,7 @@
|
||||||
#include "freertos/xtensa_api.h"
|
#include "freertos/xtensa_api.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
#include "esp_timer_impl.h"
|
#include "esp_private/esp_timer_impl.h"
|
||||||
|
|
||||||
#ifdef CONFIG_ESP_TIMER_PROFILING
|
#ifdef CONFIG_ESP_TIMER_PROFILING
|
||||||
#define WITH_PROFILING 1
|
#define WITH_PROFILING 1
|
|
@ -32,7 +32,7 @@
|
||||||
#include "freertos/xtensa_api.h"
|
#include "freertos/xtensa_api.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
#include "esp_timer_impl.h"
|
#include "esp_private/esp_timer_impl.h"
|
||||||
|
|
||||||
/* We abuse 'timer_arg' field of ETSTimer structure to hold a pointer to esp_timer */
|
/* We abuse 'timer_arg' field of ETSTimer structure to hold a pointer to esp_timer */
|
||||||
#define ESP_TIMER(p_ets_timer) ((esp_timer_handle_t) (p_ets_timer)->timer_arg)
|
#define ESP_TIMER(p_ets_timer) ((esp_timer_handle_t) (p_ets_timer)->timer_arg)
|
|
@ -19,7 +19,7 @@
|
||||||
#include "esp_system.h"
|
#include "esp_system.h"
|
||||||
#include "sys/queue.h"
|
#include "sys/queue.h"
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "pm_impl.h"
|
#include "esp_private/pm_impl.h"
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
#include "sdkconfig.h"
|
#include "sdkconfig.h"
|
||||||
|
|
Loading…
Reference in a new issue