1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

pkg/nimble: cleanup dep resolution for PHY modes

This commit is contained in:
Hauke Petersen 2021-12-06 13:08:23 +01:00
parent 99d245f538
commit f5aba5301d
2 changed files with 17 additions and 16 deletions

View File

@ -12,6 +12,15 @@ USEMODULE += nimble_riot_contrib
# RIOT port
USEMODULE += nimble_porting_nimble
# Pull in dependencies based on used features
ifneq (,$(filter ble_phy_coded,$(FEATURES_USED)))
USEMODULE += nimble_phy_coded
endif
ifneq (,$(filter ble_phy_2mbit,$(FEATURES_USED)))
USEMODULE += nimble_phy_2mbit
endif
# NOTE: this dependency depends on inclusion order, for it to work properly
# mynewt-core should be selected as nimble backend as early as possible,
# i.e. at the application level.
@ -67,10 +76,6 @@ ifneq (,$(filter nimble_autoconn,$(USEMODULE)))
USEMODULE += bluetil_ad
endif
ifneq (,$(filter nimble_phy_%,$(USEMODULE)))
USEMODULE += nimble_adv_ext
endif
ifneq (,$(filter nimble_phy_2mbit,$(USEMODULE)))
FEATURES_REQUIRED += ble_phy_2mbit
endif

View File

@ -26,6 +26,14 @@ ifneq (,$(filter nimble_controller,$(USEMODULE)))
ifneq (,$(filter nimble_drivers_nrf5x,$(USEMODULE)))
INCLUDES += $(NIMIBASE)/nimble/drivers/$(CPU_FAM)/include
endif
# Enable additional PHY modes if requested by the build
ifneq (,$(filter ble_phy_2mbit,$(FEATURES_USED)))
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_LE_2M_PHY=1
endif
ifneq (,$(filter ble_phy_coded,$(FEATURES_USED)))
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_LE_CODED_PHY=1
endif
endif
# include nimble host headers
@ -94,18 +102,6 @@ ifneq (,$(filter nimble_adv_ext,$(USEMODULE)))
endif
endif
ifneq (,$(filter nimble_phy_2mbit,$(USEMODULE)))
ifneq (,$(filter nimble_controller,$(USEMODULE)))
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_LE_2M_PHY=1
endif
endif
ifneq (,$(filter nimble_phy_coded,$(USEMODULE)))
ifneq (,$(filter nimble_controller,$(USEMODULE)))
CFLAGS += -DMYNEWT_VAL_BLE_LL_CFG_FEAT_LE_CODED_PHY=1
endif
endif
ifneq (,$(filter nimble_netif,$(USEMODULE)))
INCLUDES += -I$(RIOTPKG)/nimble/netif/include