diff --git a/cpu/nrf5x_common/Makefile.dep b/cpu/nrf5x_common/Makefile.dep index 7c54a45a71..13fa0087ab 100644 --- a/cpu/nrf5x_common/Makefile.dep +++ b/cpu/nrf5x_common/Makefile.dep @@ -10,3 +10,7 @@ USEMODULE += cpu_common FEATURES_OPTIONAL += vdd_lc_filter_reg1 # reg0 feature denotes stage 0 two-stage regulator models FEATURES_OPTIONAL += vdd_lc_filter_reg0 + +ifneq (,$(filter nimble,$(USEPKG))) + USEPKG += nrfx +endif diff --git a/pkg/nimble/Makefile b/pkg/nimble/Makefile index ee32f8a689..991ca45d6c 100644 --- a/pkg/nimble/Makefile +++ b/pkg/nimble/Makefile @@ -38,7 +38,7 @@ nimble_porting_nimble: $(QQ)"$(MAKE)" -C $(PDIR)/porting/nimble/src/ -f $(RIOTPKG)/$(PKG_NAME)/nimble.porting.mk MODULE=$@ nimble_npl_riot: - $(QQ)"$(MAKE)" -C $(PDIR)/porting/npl/riot/src/ -f $(RIOTBASE)/Makefile.base MODULE=$@ + $(QQ)"$(MAKE)" -C $(PDIR)/porting/npl/riot/src/ -f $(RIOTPKG)/$(PKG_NAME)/nimble.npl.mk MODULE=$@ # generic modules nimble_transport: diff --git a/pkg/nimble/Makefile.dep b/pkg/nimble/Makefile.dep index 305bab9c6a..0e25b7851e 100644 --- a/pkg/nimble/Makefile.dep +++ b/pkg/nimble/Makefile.dep @@ -3,8 +3,6 @@ USEMODULE += sema USEMODULE += event_callback USEMODULE += ztimer_msec -USEPKG += nrfx - # Requires nimble feature FEATURES_REQUIRED += ble_nimble diff --git a/pkg/nimble/nimble.npl.mk b/pkg/nimble/nimble.npl.mk new file mode 100644 index 0000000000..ae8b68775a --- /dev/null +++ b/pkg/nimble/nimble.npl.mk @@ -0,0 +1,7 @@ +ifeq (,$(filter nrf51 nrf52 nrf53,$(CPU_FAM))) + # nrf5x_isr.c does only compile for nRF5x MCUs + IGNORE := nrf5x_isr.c + SRC := $(filter-out $(IGNORE),$(wildcard *.c)) +endif + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/nimble/nimble.porting.mk b/pkg/nimble/nimble.porting.mk index 84cb2c3609..afb6086e77 100644 --- a/pkg/nimble/nimble.porting.mk +++ b/pkg/nimble/nimble.porting.mk @@ -1,5 +1,9 @@ ifneq (,$(filter mynewt-core,$(USEMODULE))) SRC = nimble_port.c +else ifeq (,$(filter nrf51 nrf52 nrf53,$(CPU_FAM))) + # hal_timer.c does only compile for nRF5x MCUs + IGNORE := hal_timer.c + SRC := $(filter-out $(IGNORE),$(wildcard *.c)) endif include $(RIOTBASE)/Makefile.base