mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_hw_support: create component
This commit is contained in:
parent
b6e763ac86
commit
988be69466
@ -80,6 +80,7 @@
|
|||||||
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
|
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
|
||||||
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
|
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
|
||||||
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
|
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
|
||||||
|
/components/esp_hw_support/ @esp-idf-codeowners/system
|
||||||
/components/esp_ipc/ @esp-idf-codeowners/system
|
/components/esp_ipc/ @esp-idf-codeowners/system
|
||||||
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
|
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
|
||||||
/components/esp_netif/ @esp-idf-codeowners/network
|
/components/esp_netif/ @esp-idf-codeowners/network
|
||||||
|
@ -15,10 +15,10 @@ if(NOT IDF_TARGET)
|
|||||||
"in by the parent build process.")
|
"in by the parent build process.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(COMPONENTS bootloader esptool_py partition_table soc bootloader_support log spi_flash micro-ecc main efuse)
|
set(COMPONENTS bootloader esptool_py esp_hw_support hal partition_table soc bootloader_support log spi_flash micro-ecc main efuse)
|
||||||
set(BOOTLOADER_BUILD 1)
|
set(BOOTLOADER_BUILD 1)
|
||||||
include("${IDF_PATH}/tools/cmake/project.cmake")
|
include("${IDF_PATH}/tools/cmake/project.cmake")
|
||||||
set(common_req log esp_rom esp_common xtensa)
|
set(common_req log esp_rom esp_common esp_hw_support hal xtensa)
|
||||||
if(LEGACY_INCLUDE_COMMON_HEADERS)
|
if(LEGACY_INCLUDE_COMMON_HEADERS)
|
||||||
list(APPEND common_req soc hal)
|
list(APPEND common_req soc hal)
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,7 +8,7 @@ endif
|
|||||||
|
|
||||||
PROJECT_NAME := bootloader
|
PROJECT_NAME := bootloader
|
||||||
|
|
||||||
COMPONENTS := esptool_py bootloader_support log spi_flash micro-ecc soc main efuse esp_rom hal
|
COMPONENTS := esp_hw_support esptool_py bootloader_support log spi_flash micro-ecc soc main efuse esp_rom hal
|
||||||
|
|
||||||
# Clear C and CXX from top level project
|
# Clear C and CXX from top level project
|
||||||
CFLAGS =
|
CFLAGS =
|
||||||
|
@ -25,7 +25,7 @@ else()
|
|||||||
# Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
|
# Note: esp_ipc, esp_pm added as a public requirement to keep compatibility as to be located here.
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
REQUIRES ${target} espcoredump esp_timer esp_ipc esp_pm
|
REQUIRES ${target} espcoredump esp_timer esp_ipc esp_pm esp_hw_support
|
||||||
PRIV_REQUIRES soc
|
PRIV_REQUIRES soc
|
||||||
LDFRAGMENTS "linker.lf")
|
LDFRAGMENTS "linker.lf")
|
||||||
|
|
||||||
|
4
components/esp_hw_support/CMakeLists.txt
Normal file
4
components/esp_hw_support/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
idf_component_register(SRCS "compare_set.c"
|
||||||
|
"cpu_util.c"
|
||||||
|
INCLUDE_DIRS include
|
||||||
|
REQUIRES soc)
|
7
components/esp_hw_support/README.md
Normal file
7
components/esp_hw_support/README.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
## `esp_hw_support` ##
|
||||||
|
|
||||||
|
This component contains hardware-related operations for supporting the system. These operations
|
||||||
|
are one level above that of `hal` in that these(1) use system services such as memory allocation, logging, scheduling
|
||||||
|
or (2) may be multi-step operations involving/affecting multiple parts of the SoC.
|
||||||
|
|
||||||
|
Implementations that don't fit other components cleanly, but are not worth creating a new component for (yet) may also be placed here as long as they don't pull dependencies other than the core system components.
|
2
components/esp_hw_support/component.mk
Normal file
2
components/esp_hw_support/component.mk
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
COMPONENT_SRCDIRS := .
|
||||||
|
COMPONENT_ADD_INCLUDEDIRS := . include
|
@ -21,6 +21,9 @@
|
|||||||
#include "soc/soc_memory_layout.h"
|
#include "soc/soc_memory_layout.h"
|
||||||
#include "xtensa/xtruntime.h"
|
#include "xtensa/xtruntime.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void __attribute__((always_inline)) compare_and_set_native(volatile uint32_t *addr, uint32_t compare, uint32_t *set)
|
static inline void __attribute__((always_inline)) compare_and_set_native(volatile uint32_t *addr, uint32_t compare, uint32_t *set)
|
||||||
{
|
{
|
||||||
@ -53,4 +56,8 @@ static inline void __attribute__((always_inline)) compare_and_set_native(volatil
|
|||||||
|
|
||||||
void compare_and_set_extram(volatile uint32_t *addr, uint32_t compare, uint32_t *set);
|
void compare_and_set_extram(volatile uint32_t *addr, uint32_t compare, uint32_t *set);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -21,6 +21,9 @@
|
|||||||
#include "soc/compare_set.h"
|
#include "soc/compare_set.h"
|
||||||
#include "xtensa/xtruntime.h"
|
#include "xtensa/xtruntime.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SPIRAM_WORKAROUND_NEED_VOLATILE_SPINLOCK
|
#ifdef CONFIG_SPIRAM_WORKAROUND_NEED_VOLATILE_SPINLOCK
|
||||||
#define NEED_VOLATILE_MUX volatile
|
#define NEED_VOLATILE_MUX volatile
|
||||||
@ -154,5 +157,9 @@ static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *l
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1,13 +1,10 @@
|
|||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
idf_component_register(SRCS "src/cpu_util.c"
|
idf_component_register(SRCS "src/lldesc.c"
|
||||||
"src/memory_layout_utils.c"
|
|
||||||
"src/lldesc.c"
|
|
||||||
"src/soc_include_legacy_warn.c"
|
"src/soc_include_legacy_warn.c"
|
||||||
"src/compare_set.c"
|
"src/memory_layout_utils.c"
|
||||||
REQUIRES hal #cpu.h directly includes HAL header
|
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
PRIV_REQUIRES ${target}
|
PRIV_REQUIRES hal # [refactor-todo] soc dependency on hal for rtc sources
|
||||||
LDFRAGMENTS linker.lf)
|
LDFRAGMENTS linker.lf)
|
||||||
|
|
||||||
add_subdirectory(soc)
|
add_subdirectory(soc)
|
||||||
|
@ -138,11 +138,11 @@ INPUT = \
|
|||||||
$(IDF_PATH)/components/hal/include/hal/adc_types.h \
|
$(IDF_PATH)/components/hal/include/hal/adc_types.h \
|
||||||
$(IDF_PATH)/components/hal/include/hal/twai_types.h \
|
$(IDF_PATH)/components/hal/include/hal/twai_types.h \
|
||||||
$(IDF_PATH)/components/hal/include/hal/touch_sensor_types.h \
|
$(IDF_PATH)/components/hal/include/hal/touch_sensor_types.h \
|
||||||
$(IDF_PATH)/components/soc/soc/esp32/include/soc/adc_channel.h \
|
$(IDF_PATH)/components/soc/esp32/include/soc/adc_channel.h \
|
||||||
$(IDF_PATH)/components/soc/soc/esp32/include/soc/dac_channel.h \
|
$(IDF_PATH)/components/soc/esp32/include/soc/dac_channel.h \
|
||||||
$(IDF_PATH)/components/soc/soc/esp32/include/soc/touch_sensor_channel.h \
|
$(IDF_PATH)/components/soc/esp32/include/soc/touch_sensor_channel.h \
|
||||||
$(IDF_PATH)/components/soc/soc/esp32/include/soc/uart_channel.h \
|
$(IDF_PATH)/components/soc/esp32/include/soc/uart_channel.h \
|
||||||
$(IDF_PATH)/components/soc/soc/esp32/include/soc/rtc_io_channel.h \
|
$(IDF_PATH)/components/soc/esp32/include/soc/rtc_io_channel.h \
|
||||||
## esp_netif - API Reference
|
## esp_netif - API Reference
|
||||||
$(IDF_PATH)/components/esp_netif/include/esp_netif.h \
|
$(IDF_PATH)/components/esp_netif/include/esp_netif.h \
|
||||||
$(IDF_PATH)/components/esp_netif/include/esp_netif_net_stack.h \
|
$(IDF_PATH)/components/esp_netif/include/esp_netif_net_stack.h \
|
||||||
|
@ -327,7 +327,7 @@ The ESP-IDF FreeRTOS critical section functions have been modified as follows…
|
|||||||
section functions (``port*_CRITICAL`` in Non-ISR and ``port*_CRITICAL_ISR`` in ISR)
|
section functions (``port*_CRITICAL`` in Non-ISR and ``port*_CRITICAL_ISR`` in ISR)
|
||||||
in order to be in compliance with Vanilla FreeRTOS.
|
in order to be in compliance with Vanilla FreeRTOS.
|
||||||
|
|
||||||
For more details see :component_file:`soc/include/soc/spinlock.h`
|
For more details see :component_file:`esp_hw_support/include/soc/spinlock.h`
|
||||||
and :component_file:`freertos/tasks.c`
|
and :component_file:`freertos/tasks.c`
|
||||||
|
|
||||||
It should be noted that when modifying vanilla FreeRTOS code to be ESP-IDF
|
It should be noted that when modifying vanilla FreeRTOS code to be ESP-IDF
|
||||||
|
@ -154,7 +154,8 @@ function(__build_init idf_path)
|
|||||||
# Set components required by all other components in the build
|
# Set components required by all other components in the build
|
||||||
#
|
#
|
||||||
# - lwip is here so that #include <sys/socket.h> works without any special provisions
|
# - lwip is here so that #include <sys/socket.h> works without any special provisions
|
||||||
set(requires_common cxx newlib freertos heap log lwip soc hal esp_rom esp_common esp_system xtensa)
|
# - esp_hw_support is here for backward compatibility
|
||||||
|
set(requires_common cxx newlib freertos esp_hw_support heap log lwip soc hal esp_rom esp_common esp_system xtensa)
|
||||||
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${requires_common}")
|
idf_build_set_property(__COMPONENT_REQUIRES_COMMON "${requires_common}")
|
||||||
|
|
||||||
__build_get_idf_git_revision()
|
__build_get_idf_git_revision()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user