2020-03-19 14:06:47 +01:00
|
|
|
# Add modules implementing used features
|
|
|
|
#
|
|
|
|
# This is done after the regular dependency resolution in Makefile.dep, as
|
|
|
|
# feature resolution depends on the used modules. As these modules however have
|
|
|
|
# no dependencies(except for periph_common), no dependency resolution is needed.
|
|
|
|
|
|
|
|
PERIPH_FEATURES := $(filter periph_%,$(FEATURES_USED))
|
|
|
|
# all periph features correspond to a periph submodule
|
|
|
|
# FEATURES_USED is defined in Makefile.features
|
|
|
|
USEMODULE += $(PERIPH_FEATURES)
|
|
|
|
|
|
|
|
# Add all USED periph_% init modules unless they are blacklisted
|
|
|
|
ifneq (,$(filter periph_init, $(USEMODULE)))
|
|
|
|
PERIPH_MODULES := $(filter-out periph_init% periph_common,\
|
|
|
|
$(filter periph_%,$(USEMODULE)))
|
|
|
|
# Use simple expansion to avoid USEMODULE referencing itself
|
|
|
|
PERIPH_INIT_MODULES := $(subst periph_,periph_init_,$(PERIPH_MODULES))
|
|
|
|
DEFAULT_MODULE += $(PERIPH_INIT_MODULES)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# select cpu_check_address pseudomodule if the corresponding feature is used
|
|
|
|
USEMODULE += $(filter cpu_check_address, $(FEATURES_USED))
|
|
|
|
|
2020-09-04 13:48:59 +02:00
|
|
|
# include puf_sram if used
|
|
|
|
USEMODULE += $(filter puf_sram, $(FEATURES_USED))
|
|
|
|
|
2020-03-19 14:06:47 +01:00
|
|
|
# include periph_common if any periph_* driver is used
|
|
|
|
ifneq (,$(filter periph_%, $(USEMODULE)))
|
|
|
|
USEMODULE += periph_common
|
|
|
|
endif
|
2020-06-04 21:25:58 +02:00
|
|
|
|
|
|
|
# select cortexm_svc pseudomodule if the corresponding feature is used
|
|
|
|
USEMODULE += $(filter cortexm_svc, $(FEATURES_USED))
|
2020-06-04 21:52:57 +02:00
|
|
|
|
|
|
|
# select core_idle_thread if the feature no_idle_thread is *not* used
|
|
|
|
ifeq (, $(filter no_idle_thread, $(FEATURES_USED)))
|
|
|
|
USEMODULE += core_idle_thread
|
|
|
|
endif
|
2020-06-25 15:57:55 +02:00
|
|
|
|
|
|
|
# use mpu_stack_guard if the feature is used
|
|
|
|
ifneq (,$(filter cortexm_mpu,$(FEATURES_USED)))
|
|
|
|
USEMODULE += mpu_stack_guard
|
|
|
|
endif
|