Skip to content

Commit

Permalink
component/bt: add another bt-lib submodule and refactor the directories
Browse files Browse the repository at this point in the history
  • Loading branch information
wmy-espressif committed Apr 21, 2021
1 parent b81c687 commit d703424
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
path = components/esptool_py/esptool
url = ../../espressif/esptool.git

[submodule "components/bt/controller/lib_esp32"]
path = components/bt/controller/lib_esp32
url = ../../espressif/esp32-bt-lib.git

[submodule "components/bootloader/subproject/components/micro-ecc/micro-ecc"]
path = components/bootloader/subproject/components/micro-ecc/micro-ecc
url = ../../kmackay/micro-ecc.git
Expand Down Expand Up @@ -90,3 +94,7 @@
[submodule "components/openthread/openthread"]
path = components/openthread/openthread
url = ../../espressif/openthread.git

[submodule "components/bt/controller/lib_esp32c3_family"]
path = components/bt/controller/lib_esp32c3_family
url = ../../espressif/esp32c3-bt-lib.git
8 changes: 5 additions & 3 deletions components/bt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -589,13 +589,15 @@ idf_component_register(SRCS "${srcs}"
if(CONFIG_BT_ENABLED)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough -Wno-unused-const-variable)
if(CONFIG_IDF_TARGET_ESP32)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/controller/lib/esp32")
target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32/esp32")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
elseif(CONFIG_IDF_TARGET_ESP32C3)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/controller/lib/esp32c3")
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-L${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32c3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app btbb)
elseif(CONFIG_IDF_TARGET_ESP32S3)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-L${CMAKE_CURRENT_LIST_DIR}/controller/lib/esp32s3")
target_link_libraries(${COMPONENT_LIB} INTERFACE
"-L${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app btbb)
endif()
endif()
Expand Down
6 changes: 3 additions & 3 deletions components/bt/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ COMPONENT_ADD_INCLUDEDIRS := include

LIBS := btdm_app

COMPONENT_ADD_LDFLAGS := -lbt -L $(COMPONENT_PATH)/controller/lib/esp32 \
COMPONENT_ADD_LDFLAGS := -lbt -L $(COMPONENT_PATH)/controller/lib_esp32/esp32 \
$(addprefix -l,$(LIBS))

# re-link program if BT binary libs change
COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/controller/lib/esp32/lib%.a,$(LIBS))
COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/controller/lib_esp32/esp32/lib%.a,$(LIBS))

COMPONENT_SUBMODULES += controller/lib
COMPONENT_SUBMODULES += controller/lib_esp32
COMPONENT_ADD_LDFRAGMENTS += linker.lf


Expand Down
1 change: 1 addition & 0 deletions components/bt/controller/lib_esp32
Submodule lib_esp32 added at ec61ca
1 change: 1 addition & 0 deletions components/bt/controller/lib_esp32c3_family
Submodule lib_esp32c3_family added at 498df3

0 comments on commit d703424

Please sign in to comment.