From e19ec25dc67a9308e8e428288d23cc2c59593e5a Mon Sep 17 00:00:00 2001 From: Slavey Karadzhov Date: Tue, 10 May 2022 15:02:50 +0200 Subject: [PATCH] Introduce Bluetooth ESP32-only component and require it from NimBLE. --- .../Esp32/Components/{bt => bluetooth}/.cs | 0 .../Components/{bt => bluetooth}/README.rst | 0 .../Esp32/Components/bluetooth/component.mk | 44 +++++++++++++++++++ Sming/Arch/Esp32/Components/bt/component.mk | 5 --- .../Arch/Esp32/Components/esp32/component.mk | 30 +------------ .../Esp32/Components/sming-arch/component.mk | 3 +- Sming/Libraries/NimBLE/component.mk | 2 + 7 files changed, 49 insertions(+), 35 deletions(-) rename Sming/Arch/Esp32/Components/{bt => bluetooth}/.cs (100%) rename Sming/Arch/Esp32/Components/{bt => bluetooth}/README.rst (100%) create mode 100644 Sming/Arch/Esp32/Components/bluetooth/component.mk delete mode 100644 Sming/Arch/Esp32/Components/bt/component.mk diff --git a/Sming/Arch/Esp32/Components/bt/.cs b/Sming/Arch/Esp32/Components/bluetooth/.cs similarity index 100% rename from Sming/Arch/Esp32/Components/bt/.cs rename to Sming/Arch/Esp32/Components/bluetooth/.cs diff --git a/Sming/Arch/Esp32/Components/bt/README.rst b/Sming/Arch/Esp32/Components/bluetooth/README.rst similarity index 100% rename from Sming/Arch/Esp32/Components/bt/README.rst rename to Sming/Arch/Esp32/Components/bluetooth/README.rst diff --git a/Sming/Arch/Esp32/Components/bluetooth/component.mk b/Sming/Arch/Esp32/Components/bluetooth/component.mk new file mode 100644 index 0000000000..a111366301 --- /dev/null +++ b/Sming/Arch/Esp32/Components/bluetooth/component.mk @@ -0,0 +1,44 @@ +COMPONENT_LIBNAME := + +COMPONENT_DEPENDS := esp32 + +EXTRA_LIBS += \ + bt \ + btdm_app + +SDK_LIBDIRS := \ + bt/controller/lib_esp32/$(ESP_VARIANT)/ \ + bt/controller/lib_esp32c3_family/$(ESP_VARIANT)/ + +LIBDIRS += \ + $(addprefix $(SDK_COMPONENTS_PATH)/,$(SDK_LIBDIRS)) + +SDK_INCDIRS := \ + bt/include/$(ESP_VARIANT)/include \ + bt/common/api/include/api \ + bt/common/btc/profile/esp/blufi/include \ + bt/common/btc/profile/esp/include \ + bt/common/osi/include \ + bt/host/nimble/nimble/nimble/include \ + bt/host/nimble/nimble/nimble/host/include \ + bt/host/nimble/nimble/porting/nimble/include \ + bt/host/nimble/nimble/porting/npl/freertos/include \ + bt/host/nimble/nimble/nimble/host/services/ans/include \ + bt/host/nimble/nimble/nimble/host/services/bas/include \ + bt/host/nimble/nimble/nimble/host/services/dis/include \ + bt/host/nimble/nimble/nimble/host/services/gap/include \ + bt/host/nimble/nimble/nimble/host/services/gatt/include \ + bt/host/nimble/nimble/nimble/host/services/ias/include \ + bt/host/nimble/nimble/nimble/host/services/ipss/include \ + bt/host/nimble/nimble/nimble/host/services/lls/include \ + bt/host/nimble/nimble/nimble/host/services/tps/include \ + bt/host/nimble/nimble/nimble/host/util/include \ + bt/host/nimble/nimble/nimble/host/store/ram/include \ + bt/host/nimble/nimble/nimble/host/store/config/include \ + bt/host/nimble/esp-hci/include \ + bt/host/nimble/port/include + +COMPONENT_INCDIRS := \ + $(addprefix $(SDK_COMPONENTS_PATH)/,$(SDK_INCDIRS)) + +DISABLE_NETWORK := 0 diff --git a/Sming/Arch/Esp32/Components/bt/component.mk b/Sming/Arch/Esp32/Components/bt/component.mk deleted file mode 100644 index 92649fa111..0000000000 --- a/Sming/Arch/Esp32/Components/bt/component.mk +++ /dev/null @@ -1,5 +0,0 @@ -COMPONENT_LIBNAME := - -COMPONENT_DEPENDS := esp32 - -EXTRA_LIBS += btdm_app diff --git a/Sming/Arch/Esp32/Components/esp32/component.mk b/Sming/Arch/Esp32/Components/esp32/component.mk index 72173263a2..830517d16d 100644 --- a/Sming/Arch/Esp32/Components/esp32/component.mk +++ b/Sming/Arch/Esp32/Components/esp32/component.mk @@ -20,8 +20,7 @@ SDK_LIBDIRS := \ xtensa/$(ESP_VARIANT)/ \ hal/$(ESP_VARIANT)/ \ $(ESP_VARIANT)/ld \ - esp_rom/$(ESP_VARIANT)/ld \ - bt/controller/lib_esp32/$(ESP_VARIANT)/ + esp_rom/$(ESP_VARIANT)/ld ESP32_COMPONENT_PATH := $(COMPONENT_PATH) SDK_DEFAULT_PATH := $(ESP32_COMPONENT_PATH)/sdk @@ -38,29 +37,6 @@ SDK_INCDIRS := \ app_update/include \ bootloader_support/include \ bootloader_support/include_bootloader \ - bt/include/$(ESP_VARIANT)/include \ - bt/common/api/include/api \ - bt/common/btc/profile/esp/blufi/include \ - bt/common/btc/profile/esp/include \ - bt/common/osi/include \ - bt/host/nimble/nimble/nimble/include \ - bt/host/nimble/nimble/nimble/host/include \ - bt/host/nimble/nimble/porting/nimble/include \ - bt/host/nimble/nimble/porting/npl/freertos/include \ - bt/host/nimble/nimble/nimble/host/services/ans/include \ - bt/host/nimble/nimble/nimble/host/services/bas/include \ - bt/host/nimble/nimble/nimble/host/services/dis/include \ - bt/host/nimble/nimble/nimble/host/services/gap/include \ - bt/host/nimble/nimble/nimble/host/services/gatt/include \ - bt/host/nimble/nimble/nimble/host/services/ias/include \ - bt/host/nimble/nimble/nimble/host/services/ipss/include \ - bt/host/nimble/nimble/nimble/host/services/lls/include \ - bt/host/nimble/nimble/nimble/host/services/tps/include \ - bt/host/nimble/nimble/nimble/host/util/include \ - bt/host/nimble/nimble/nimble/host/store/ram/include \ - bt/host/nimble/nimble/nimble/host/store/config/include \ - bt/host/nimble/esp-hci/include \ - bt/host/nimble/port/include \ driver/$(ESP_VARIANT)/include \ driver/include \ esp_pm/include \ @@ -142,7 +118,6 @@ SDK_COMPONENTS := \ ifneq ($(DISABLE_NETWORK),1) SDK_COMPONENTS += \ - bt \ esp_wifi \ esp_eth \ lwip \ @@ -167,8 +142,6 @@ SDK_COMPONENTS += xtensa endif SDK_ESP_WIFI_LIBS := \ - bt \ - coexist \ core \ espnow \ mesh \ @@ -188,6 +161,7 @@ SDK_TARGET_ARCH_LIBS := hal xt_hal endif EXTRA_LIBS := \ + coexist \ $(SDK_COMPONENTS) \ $(SDK_TARGET_ARCH_LIBS) diff --git a/Sming/Arch/Esp32/Components/sming-arch/component.mk b/Sming/Arch/Esp32/Components/sming-arch/component.mk index 69d3a3cb76..189237cbae 100644 --- a/Sming/Arch/Esp32/Components/sming-arch/component.mk +++ b/Sming/Arch/Esp32/Components/sming-arch/component.mk @@ -18,8 +18,7 @@ COMPONENT_DEPENDS := \ heap \ esp32 \ gdbstub \ - esptool \ - bt + esptool # ELF and BIN files DEBUG_VARS += TARGET_BIN TARGET_OUT diff --git a/Sming/Libraries/NimBLE/component.mk b/Sming/Libraries/NimBLE/component.mk index d425619807..695db55dc1 100644 --- a/Sming/Libraries/NimBLE/component.mk +++ b/Sming/Libraries/NimBLE/component.mk @@ -1,5 +1,7 @@ COMPONENT_SUBMODULES := esp-nimble-cpp COMPONENT_SOC := esp32* +COMPONENT_DEPENDS := bluetooth + COMPONENT_SRCDIRS := esp-nimble-cpp/src COMPONENT_INCDIRS := $(COMPONENT_SRCDIRS)