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
|
2022-02-09 14:25:04 +01:00
|
|
|
PERIPH_IGNORE_MODULES := \
|
2023-08-29 18:54:57 +02:00
|
|
|
periph_cipher_aes_128_cbc \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_clic \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_common \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_coretimer \
|
2023-08-29 18:54:57 +02:00
|
|
|
periph_cryptocell_310 \
|
|
|
|
periph_ecc_p192r1 \
|
|
|
|
periph_ecc_p256r1 \
|
2023-10-09 16:47:04 +02:00
|
|
|
periph_ecc_ed25519 \
|
2022-08-16 10:57:04 +02:00
|
|
|
periph_eth \
|
|
|
|
periph_eth_common \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_flash \
|
2022-08-16 10:57:04 +02:00
|
|
|
periph_flashpage_in_address_space \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_flexcomm \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_gpio_ll \
|
|
|
|
periph_gpio_ll_irq \
|
|
|
|
periph_gpio_ll_irq_level_triggered_high \
|
|
|
|
periph_gpio_ll_irq_level_triggered_low \
|
|
|
|
periph_gpio_ll_irq_unmask \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_gpio_mux \
|
2023-08-29 18:54:57 +02:00
|
|
|
periph_hash_sha_1 \
|
|
|
|
periph_hash_sha_224 \
|
|
|
|
periph_hash_sha_256 \
|
|
|
|
periph_hash_sha_512 \
|
|
|
|
periph_hmac_sha_256 \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_i2c_hw \
|
|
|
|
periph_i2c_sw \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_init% \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_mcg \
|
2022-08-12 10:40:16 +02:00
|
|
|
periph_mcg_lite \
|
2022-08-16 10:57:04 +02:00
|
|
|
periph_nvm \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_plic \
|
|
|
|
periph_rtc_ms \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_rtc_rtt \
|
|
|
|
periph_rtt_hw_rtc \
|
|
|
|
periph_rtt_hw_sys \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_spi_on_qspi \
|
2021-04-19 21:42:26 +02:00
|
|
|
periph_timer_query_freqs \
|
2022-08-16 10:57:04 +02:00
|
|
|
periph_uart_collision \
|
|
|
|
periph_uart_rxstart_irq \
|
2022-05-24 11:47:13 +02:00
|
|
|
periph_wdog \
|
2023-04-24 15:40:15 +02:00
|
|
|
periph_wdt_auto_start \
|
2022-02-09 14:25:04 +01:00
|
|
|
#
|
|
|
|
PERIPH_MODULES := $(filter-out $(PERIPH_IGNORE_MODULES),\
|
|
|
|
$(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)
|
2020-03-19 14:06:47 +01:00
|
|
|
|
|
|
|
# select cpu_check_address pseudomodule if the corresponding feature is used
|
|
|
|
USEMODULE += $(filter cpu_check_address, $(FEATURES_USED))
|
|
|
|
|
2020-06-11 16:14:11 +02:00
|
|
|
# select bootloader_stm32 module if the feature is used
|
|
|
|
USEMODULE += $(filter bootloader_stm32, $(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
|
|
|
|
2021-12-19 16:24:48 +01:00
|
|
|
# include rtc_utils if periph_rtc is used
|
2022-01-18 13:45:21 +01:00
|
|
|
ifneq (,$(filter periph_rtc,$(USEMODULE)))
|
2021-12-19 16:24:48 +01:00
|
|
|
USEMODULE += rtc_utils
|
|
|
|
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
|
2020-11-18 17:26:02 +01:00
|
|
|
|
2021-01-26 14:55:40 +01:00
|
|
|
# use picolibc if the feature is used
|
|
|
|
ifneq (,$(filter picolibc,$(FEATURES_USED)))
|
|
|
|
USEMODULE += picolibc
|
|
|
|
endif
|
|
|
|
|
|
|
|
# use newlib if the feature is used
|
|
|
|
ifneq (,$(filter newlib,$(FEATURES_USED)))
|
|
|
|
USEMODULE += newlib
|
|
|
|
endif
|
|
|
|
|
2020-11-18 17:26:02 +01:00
|
|
|
# use efm32_coretemp if the feature is used
|
|
|
|
USEMODULE += $(filter efm32_coretemp, $(FEATURES_USED))
|
2021-02-15 15:45:03 +01:00
|
|
|
|
|
|
|
# if LC filter(s) is attached to the CPUs voltage regulator, use it
|
|
|
|
USEMODULE += $(filter vdd_lc_filter_%,$(FEATURES_USED))
|
2021-11-12 11:54:22 +01:00
|
|
|
|
|
|
|
# select arduino_pwm pseudomodule if the corresponding feature is used
|
|
|
|
USEMODULE += $(filter arduino_pwm, $(FEATURES_USED))
|
2023-02-02 13:49:14 +01:00
|
|
|
|
|
|
|
# always register a peripheral driver as a required feature when the corresponding
|
|
|
|
# module is requested
|
2023-04-24 16:50:47 +02:00
|
|
|
PERIPH_IGNORE_MODULES += periph_usbdev_clk periph_gpio_mock periph_gpio_linux periph_spidev_linux
|
|
|
|
|
2023-02-02 13:49:14 +01:00
|
|
|
ifneq (,$(filter periph_%,$(DEFAULT_MODULE)))
|
|
|
|
FEATURES_REQUIRED += $(filter-out $(PERIPH_IGNORE_MODULES),$(filter periph_%,$(USEMODULE)))
|
|
|
|
endif
|