From 2bcf99527c5182bfd54321d30131fa242af6db8f Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Thu, 17 Sep 2020 19:26:00 +0800 Subject: [PATCH 1/4] soc: move out rtc_hal to hal component --- components/{soc => hal}/include/hal/rtc_hal.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename components/{soc => hal}/include/hal/rtc_hal.h (100%) diff --git a/components/soc/include/hal/rtc_hal.h b/components/hal/include/hal/rtc_hal.h similarity index 100% rename from components/soc/include/hal/rtc_hal.h rename to components/hal/include/hal/rtc_hal.h From 01d9aa8070dc65c9de81b3cff734f782ad70f187 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Thu, 17 Sep 2020 19:48:39 +0800 Subject: [PATCH 2/4] soc: move mpu_hal test to hal component --- components/hal/test/CMakeLists.txt | 3 +++ components/hal/test/component.mk | 5 +++++ components/{soc => hal}/test/test_mpu.c | 0 3 files changed, 8 insertions(+) create mode 100644 components/hal/test/CMakeLists.txt create mode 100644 components/hal/test/component.mk rename components/{soc => hal}/test/test_mpu.c (100%) diff --git a/components/hal/test/CMakeLists.txt b/components/hal/test/CMakeLists.txt new file mode 100644 index 0000000000..a06f271e1a --- /dev/null +++ b/components/hal/test/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRC_DIRS "." + PRIV_INCLUDE_DIRS "${include_dirs}" + PRIV_REQUIRES cmock test_utils) diff --git a/components/hal/test/component.mk b/components/hal/test/component.mk new file mode 100644 index 0000000000..6184303f65 --- /dev/null +++ b/components/hal/test/component.mk @@ -0,0 +1,5 @@ +COMPONENT_SRCDIRS := . + +COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive + + diff --git a/components/soc/test/test_mpu.c b/components/hal/test/test_mpu.c similarity index 100% rename from components/soc/test/test_mpu.c rename to components/hal/test/test_mpu.c From 7f5893d53c833d118dfcccbcf31a17601cb81796 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Thu, 17 Sep 2020 19:59:37 +0800 Subject: [PATCH 3/4] soc: move dac_hal to hal --- components/hal/CMakeLists.txt | 1 + components/{soc/src => hal}/esp32s2/dac_hal.c | 0 components/{soc/src => hal}/esp32s2/include/hal/dac_hal.h | 0 components/soc/src/esp32s2/CMakeLists.txt | 1 - 4 files changed, 1 insertion(+), 1 deletion(-) rename components/{soc/src => hal}/esp32s2/dac_hal.c (100%) rename components/{soc/src => hal}/esp32s2/include/hal/dac_hal.h (100%) diff --git a/components/hal/CMakeLists.txt b/components/hal/CMakeLists.txt index e47132462f..cb365bb3cf 100644 --- a/components/hal/CMakeLists.txt +++ b/components/hal/CMakeLists.txt @@ -53,6 +53,7 @@ if(NOT BOOTLOADER_BUILD) "esp32s2/cp_dma_hal.c" "esp32s2/systimer_hal.c" "esp32s2/touch_sensor_hal.c" + "esp32s2/dac_hal.c" "esp32s2/usb_hal.c") endif() diff --git a/components/soc/src/esp32s2/dac_hal.c b/components/hal/esp32s2/dac_hal.c similarity index 100% rename from components/soc/src/esp32s2/dac_hal.c rename to components/hal/esp32s2/dac_hal.c diff --git a/components/soc/src/esp32s2/include/hal/dac_hal.h b/components/hal/esp32s2/include/hal/dac_hal.h similarity index 100% rename from components/soc/src/esp32s2/include/hal/dac_hal.h rename to components/hal/esp32s2/include/hal/dac_hal.h diff --git a/components/soc/src/esp32s2/CMakeLists.txt b/components/soc/src/esp32s2/CMakeLists.txt index b5313224b7..0f59849121 100644 --- a/components/soc/src/esp32s2/CMakeLists.txt +++ b/components/soc/src/esp32s2/CMakeLists.txt @@ -1,5 +1,4 @@ set(srcs - "dac_hal.c" "rtc_clk.c" "rtc_clk_init.c" "rtc_init.c" From 6d7606aee59ccdccb8179107b62bc7ec69cd7197 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Thu, 17 Sep 2020 20:05:23 +0800 Subject: [PATCH 4/4] soc: remove unecessary compile line include dir orderding control --- components/soc/CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/components/soc/CMakeLists.txt b/components/soc/CMakeLists.txt index 956866dfbb..e088e3bd63 100644 --- a/components/soc/CMakeLists.txt +++ b/components/soc/CMakeLists.txt @@ -6,16 +6,11 @@ idf_component_register(SRCS "src/cpu_util.c" "src/soc_include_legacy_warn.c" "src/compare_set.c" REQUIRES hal #cpu.h directly includes HAL header + INCLUDE_DIRS include PRIV_REQUIRES ${target} LDFRAGMENTS linker.lf) - -# Since there can be chip-specific HAL headers which can include the common -# HAL header via include_next, process the build scripts here first so that -# include directories appear first in the compile command. -add_subdirectory(src/${target}) -target_include_directories(${COMPONENT_LIB} PUBLIC include) -target_link_libraries(${COMPONENT_LIB} PRIVATE idf::hal) - add_subdirectory(soc) + +add_subdirectory(src/${target}) target_link_libraries(${COMPONENT_LIB} PUBLIC "soc_${target}")