Merge branch 'feature/common_parts_into_esp_common' into 'master'

move common include files from esp32 into esp_common

See merge request idf/esp-idf!4515
This commit is contained in:
Ivan Grokhotkov 2019-03-27 17:00:58 +08:00
commit 18946a5421
32 changed files with 53 additions and 40 deletions

View File

@ -21,7 +21,7 @@
#include "soc/timer_group_struct.h" #include "soc/timer_group_struct.h"
#include "soc/timer_group_reg.h" #include "soc/timer_group_reg.h"
#include "esp_app_trace.h" #include "esp_app_trace.h"
#include "esp_dbg_stubs.h" #include "esp_private/dbg_stubs.h"
#if CONFIG_ESP32_GCOV_ENABLE #if CONFIG_ESP32_GCOV_ENABLE

View File

@ -10,11 +10,11 @@ if(NOT IDF_PATH)
"in by the parent build process.") "in by the parent build process.")
endif() endif()
set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc soc main efuse) set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc main efuse)
set(BOOTLOADER_BUILD 1) set(BOOTLOADER_BUILD 1)
add_definitions(-DBOOTLOADER_BUILD=1) add_definitions(-DBOOTLOADER_BUILD=1)
set(COMPONENT_REQUIRES_COMMON esp_rom log esp32 soc) set(COMPONENT_REQUIRES_COMMON log esp32 soc esp_rom esp_common)
include("${IDF_PATH}/tools/cmake/project.cmake") include("${IDF_PATH}/tools/cmake/project.cmake")
project(bootloader) project(bootloader)

View File

@ -14,9 +14,10 @@ COMPONENTS := esptool_py bootloader_support log spi_flash micro-ecc soc main efu
CFLAGS = CFLAGS =
CXXFLAGS = CXXFLAGS =
#We cannot include the esp32 and esp_rom component directly but we need their includes. #We cannot include the esp32, esp_rom, esp_common component directly but we need their includes.
CFLAGS += -I $(IDF_PATH)/components/esp32/include CFLAGS += -I $(IDF_PATH)/components/esp32/include
CFLAGS += -I $(IDF_PATH)/components/esp_rom/include CFLAGS += -I $(IDF_PATH)/components/esp_rom/include
CFLAGS += -I $(IDF_PATH)/components/esp_common/include
# The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included. # The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.
# #

View File

@ -22,7 +22,6 @@ set(COMPONENT_SRCS "can.c"
"uart.c") "uart.c")
set(COMPONENT_ADD_INCLUDEDIRS "include") set(COMPONENT_ADD_INCLUDEDIRS "include")
set(COMPONENT_PRIV_INCLUDEDIRS "include/driver") set(COMPONENT_PRIV_INCLUDEDIRS "include/driver")
set(COMPONENT_REQUIRES esp_ringbuf) set(COMPONENT_REQUIRES esp_ringbuf)
register_component() register_component()

View File

@ -48,8 +48,8 @@
#include "esp_event.h" #include "esp_event.h"
#include "esp_spi_flash.h" #include "esp_spi_flash.h"
#include "esp_ipc.h" #include "esp_ipc.h"
#include "esp_crosscore_int.h"
#include "esp32/dport_access.h" #include "esp32/dport_access.h"
#include "esp_private/crosscore_int.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_vfs_dev.h" #include "esp_vfs_dev.h"
#include "esp_newlib.h" #include "esp_newlib.h"
@ -63,7 +63,7 @@
#include "esp_panic.h" #include "esp_panic.h"
#include "esp_core_dump.h" #include "esp_core_dump.h"
#include "esp_app_trace.h" #include "esp_app_trace.h"
#include "esp_dbg_stubs.h" #include "esp_private/dbg_stubs.h"
#include "esp_efuse.h" #include "esp_efuse.h"
#include "esp32/spiram.h" #include "esp32/spiram.h"
#include "esp_clk_internal.h" #include "esp_clk_internal.h"

View File

@ -22,7 +22,7 @@
#include "esp32/rom/ets_sys.h" #include "esp32/rom/ets_sys.h"
#include "soc/uart_reg.h" #include "soc/uart_reg.h"
#include "soc/io_mux_reg.h" #include "soc/io_mux_reg.h"
#include "esp_gdbstub.h" #include "esp_private/gdbstub.h"
#include "esp_panic.h" #include "esp_panic.h"
#include "driver/gpio.h" #include "driver/gpio.h"
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"

View File

@ -32,7 +32,7 @@
#include "soc/rtc.h" #include "soc/rtc.h"
#include "soc/rtc_wdt.h" #include "soc/rtc_wdt.h"
#include "esp_gdbstub.h" #include "esp_private/gdbstub.h"
#include "esp_panic.h" #include "esp_panic.h"
#include "esp_attr.h" #include "esp_attr.h"
#include "esp_err.h" #include "esp_err.h"

View File

@ -21,8 +21,8 @@
#include "esp_err.h" #include "esp_err.h"
#include "esp_pm.h" #include "esp_pm.h"
#include "esp_log.h" #include "esp_log.h"
#include "esp_crosscore_int.h"
#include "esp32/clk.h" #include "esp32/clk.h"
#include "esp_private/crosscore_int.h"
#include "soc/rtc.h" #include "soc/rtc.h"

View File

@ -1,19 +1,27 @@
set(COMPONENT_SRCS if(BOOTLOADER_BUILD)
"src/dbg_stubs.c" # For bootloader, all we need from esp_common is headers
"src/esp_err_to_name.c" set(COMPONENT_ADD_INCLUDEDIRS include)
"src/esp_timer.c" set(COMPONENT_REQUIRES ${IDF_COMPONENTS})
"src/ets_timer_legacy.c" set(COMPONENT_SRCS )
"src/pm_locks.c" register_component()
"src/stack_check.c") else()
set(COMPONENT_ADD_INCLUDEDIRS "include") # Regular app build
set(COMPONENT_PRIV_INCLUDEDIRS) set(COMPONENT_SRCS
set(COMPONENT_REQUIRES) "src/dbg_stubs.c"
# dbg_stubs.c needs eri.h from xtensa-debug-module "src/esp_err_to_name.c"
set(COMPONENT_PRIV_REQUIRES "xtensa-debug-module") "src/esp_timer.c"
register_component() "src/ets_timer_legacy.c"
"src/pm_locks.c"
set_source_files_properties( "src/stack_check.c")
"src/stack_check.c" set(COMPONENT_ADD_INCLUDEDIRS "include")
PROPERTIES COMPILE_FLAGS set(COMPONENT_PRIV_INCLUDEDIRS)
-fno-stack-protector) 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)
endif()

View File

@ -18,7 +18,7 @@
#include "eri.h" #include "eri.h"
#include "xtensa-debug-module.h" #include "xtensa-debug-module.h"
#include "esp_dbg_stubs.h" #include "esp_private/dbg_stubs.h"
#include "esp_attr.h" #include "esp_attr.h"
#if CONFIG_ESP32_DEBUG_STUBS_ENABLE #if CONFIG_ESP32_DEBUG_STUBS_ENABLE

View File

@ -24,6 +24,7 @@ INCLUDE_DIRS := \
esp_rom/include \ esp_rom/include \
soc/esp32/include \ soc/esp32/include \
esp32/include \ esp32/include \
esp_common/include \
bootloader_support/include \ bootloader_support/include \
app_update/include \ app_update/include \
spi_flash/include \ spi_flash/include \

View File

@ -78,7 +78,7 @@ extern "C" {
#include <xtensa/config/core.h> #include <xtensa/config/core.h>
#include <xtensa/config/system.h> /* required for XSHAL_CLIB */ #include <xtensa/config/system.h> /* required for XSHAL_CLIB */
#include <xtensa/xtruntime.h> #include <xtensa/xtruntime.h>
#include "esp_crosscore_int.h" #include "esp_private/crosscore_int.h"
#include "esp_timer.h" /* required for FreeRTOS run time stats */ #include "esp_timer.h" /* required for FreeRTOS run time stats */

View File

@ -105,7 +105,7 @@
#include "esp_panic.h" #include "esp_panic.h"
#include "esp_heap_caps.h" #include "esp_heap_caps.h"
#include "esp_crosscore_int.h" #include "esp_private/crosscore_int.h"
#include "esp_intr_alloc.h" #include "esp_intr_alloc.h"
#include "esp_log.h" #include "esp_log.h"

View File

@ -23,6 +23,7 @@ INCLUDE_DIRS := \
) \ ) \
$(addprefix ../../../components/, \ $(addprefix ../../../components/, \
esp_rom/include \ esp_rom/include \
esp_common/include \
soc/esp32/include \ soc/esp32/include \
esp32/include \ esp32/include \
bootloader_support/include \ bootloader_support/include \

View File

@ -4,7 +4,7 @@ SOURCE_FILES := \
newlib/lock.c \ newlib/lock.c \
esp32/crc.cpp \ esp32/crc.cpp \
esp32/esp_random.c \ esp32/esp_random.c \
bootloader_support/src/bootloader_common.c bootloader_support/src/bootloader_common.c
INCLUDE_DIRS := \ INCLUDE_DIRS := \
../include \ ../include \
@ -18,6 +18,7 @@ INCLUDE_DIRS := \
sdmmc/include \ sdmmc/include \
vfs/include \ vfs/include \
$(addprefix ../../../../components/, \ $(addprefix ../../../../components/, \
esp_common/include \
soc/esp32/include \ soc/esp32/include \
esp32/include \ esp32/include \
bootloader_support/include \ bootloader_support/include \

View File

@ -25,6 +25,7 @@ INCLUDE_DIRS := \
) \ ) \
$(addprefix ../../../components/, \ $(addprefix ../../../components/, \
esp_rom/include \ esp_rom/include \
esp_common/include \
soc/esp32/include \ soc/esp32/include \
esp32/include \ esp32/include \
bootloader_support/include \ bootloader_support/include \

View File

@ -24,6 +24,7 @@ INCLUDE_DIRS := \
) \ ) \
$(addprefix ../../../components/, \ $(addprefix ../../../components/, \
esp_rom/include \ esp_rom/include \
esp_common/include \
soc/esp32/include \ soc/esp32/include \
esp32/include \ esp32/include \
bootloader_support/include \ bootloader_support/include \

View File

@ -158,8 +158,8 @@ INPUT = \
../../components/esp32/include/esp_intr_alloc.h \ ../../components/esp32/include/esp_intr_alloc.h \
## Watchdogs ## Watchdogs
## NOTE: for two lines below header_file.inc is not used ## NOTE: for two lines below header_file.inc is not used
../../components/esp32/include/esp_int_wdt.h \ ../../components/esp_common/include/esp_int_wdt.h \
../../components/esp32/include/esp_task_wdt.h \ ../../components/esp_common/include/esp_task_wdt.h \
## Hooks ## Hooks
../../components/esp32/include/esp_freertos_hooks.h \ ../../components/esp32/include/esp_freertos_hooks.h \
## Inter-Processor Call ## Inter-Processor Call
@ -174,7 +174,7 @@ INPUT = \
../../components/log/include/esp_log.h \ ../../components/log/include/esp_log.h \
## Base MAC address ## Base MAC address
## NOTE: for line below header_file.inc is not used ## NOTE: for line below header_file.inc is not used
../../components/esp32/include/esp_system.h \ ../../components/esp_common/include/esp_system.h \
## ##
## ULP Coprocessor - API Guides ## ULP Coprocessor - API Guides
## ##
@ -185,10 +185,10 @@ INPUT = \
## ##
../../components/app_trace/include/esp_app_trace.h \ ../../components/app_trace/include/esp_app_trace.h \
### Power management ### Power management
../../components/esp32/include/esp_pm.h \ ../../components/esp_common/include/esp_pm.h \
../../components/esp32/include/esp32/pm.h \ ../../components/esp32/include/esp32/pm.h \
### esp_timer, High Resolution Timer ### esp_timer, High Resolution Timer
../../components/esp32/include/esp_timer.h \ ../../components/esp_common/include/esp_timer.h \
### esp_event, Event Loop Library ### esp_event, Event Loop Library
../../components/esp_event/include/esp_event.h \ ../../components/esp_event/include/esp_event.h \
../../components/esp_event/include/esp_event_base.h \ ../../components/esp_event/include/esp_event_base.h \
@ -207,9 +207,9 @@ INPUT = \
### Ringbuffer ### Ringbuffer
../../components/esp_ringbuf/include/freertos/ringbuf.h \ ../../components/esp_ringbuf/include/freertos/ringbuf.h \
### Helper functions for error codes ### Helper functions for error codes
../../components/esp32/include/esp_err.h \ ../../components/esp_common/include/esp_err.h \
### System APIs ### System APIs
../../components/esp32/include/esp_system.h \ ../../components/esp_common/include/esp_system.h \
### Modbus controller component header file ### Modbus controller component header file
../../components/freemodbus/modbus_controller/mbcontroller.h ../../components/freemodbus/modbus_controller/mbcontroller.h

View File

@ -58,7 +58,7 @@ macro(idf_set_variables)
set_default(IDF_COMPONENT_DIRS "${IDF_EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components") set_default(IDF_COMPONENT_DIRS "${IDF_EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components")
set_default(IDF_COMPONENTS "") set_default(IDF_COMPONENTS "")
set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc") set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc esp_rom esp_common")
set(IDF_PROJECT_PATH "${CMAKE_SOURCE_DIR}") set(IDF_PROJECT_PATH "${CMAKE_SOURCE_DIR}")