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 \
|
2024-07-23 17:11:34 +02:00
|
|
|
periph_cipher_chacha20 \
|
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 \
|
2024-03-01 09:07:11 +01:00
|
|
|
periph_gpio_ll% \
|
2022-02-09 14:25:04 +01:00
|
|
|
periph_gpio_mux \
|
2023-08-29 18:54:57 +02:00
|
|
|
periph_hash_sha_1 \
|
2024-07-13 04:35:21 +02:00
|
|
|
periph_hash_sha3_256 \
|
|
|
|
periph_hash_sha3_384 \
|
|
|
|
periph_hash_sha3_512 \
|
2023-08-29 18:54:57 +02:00
|
|
|
periph_hash_sha_224 \
|
|
|
|
periph_hash_sha_256 \
|
2023-12-21 13:49:01 +01:00
|
|
|
periph_hash_sha_384 \
|
2023-08-29 18:54:57 +02:00
|
|
|
periph_hash_sha_512 \
|
2023-12-21 13:49:01 +01:00
|
|
|
periph_hash_sha_512_224 \
|
|
|
|
periph_hash_sha_512_256 \
|
2023-08-29 18:54:57 +02:00
|
|
|
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 \
|
2023-12-01 14:15:05 +01:00
|
|
|
periph_timer_poll \
|
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))
|
|
|
|
|
2024-03-26 12:51:29 +01:00
|
|
|
# select can_rx_mailbox pseudomodule if the corresponding feature is used
|
|
|
|
USEMODULE += $(filter can_rx_mailbox, $(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
|
|
|
|
|
2024-04-27 18:55:06 +02:00
|
|
|
# select cortexm_stack_limit pseudomodule if the corresponding
|
|
|
|
# feature is used
|
|
|
|
USEMODULE += $(filter cortexm_stack_limit, $(FEATURES_USED))
|
|
|
|
|
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)))
|
2024-01-09 18:59:58 +01:00
|
|
|
ifneq (,$(filter core_thread, $(USEMODULE)))
|
|
|
|
USEMODULE += core_idle_thread
|
|
|
|
endif
|
2020-06-04 21:52:57 +02:00
|
|
|
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
|