diff --git a/cpu/stm32_common/Makefile.dep b/cpu/stm32_common/Makefile.dep deleted file mode 100644 index 878dc5a7e0be6aca4766ac048364c74064037ccf..0000000000000000000000000000000000000000 --- a/cpu/stm32_common/Makefile.dep +++ /dev/null @@ -1,7 +0,0 @@ -ifneq (,$(filter periph_i2c,$(USEMODULE))) - ifneq (,$(filter $(CPU),stm32f0 stm32f3 stm32f7 stm32l0 stm32l4)) - USEMODULE += periph_i2c_1 - else # stm32f1/f2/f4/l1 - USEMODULE += periph_i2c_2 - endif -endif diff --git a/cpu/stm32_common/Makefile.include b/cpu/stm32_common/Makefile.include index 6fe4747cd9556ce831492f6858b4ed8e36e1d831..13ce83f9c2c06d1313a08080129db9f1bae8a9d1 100644 --- a/cpu/stm32_common/Makefile.include +++ b/cpu/stm32_common/Makefile.include @@ -8,12 +8,6 @@ USEMODULE += periph_common # include stm32 common functions and stm32 common periph drivers USEMODULE += stm32_common stm32_common_periph -# flashpage and eeprom periph implementations share flash lock/unlock functions -# in periph_flash_common -ifneq (,$(filter periph_flashpage periph_eeprom,$(FEATURES_REQUIRED))) - FEATURES_REQUIRED += periph_flash_common -endif - # For stm32 cpu's we use the stm32_common.ld linker script export LINKFLAGS += -L$(RIOTCPU)/stm32_common/ldscripts LINKER_SCRIPT ?= stm32_common.ld diff --git a/cpu/stm32_common/periph/Makefile b/cpu/stm32_common/periph/Makefile index 1870d4557c47314ed04c49ceb0c482cae8023dab..f4c1ed49c291e85467e304533f53d2aee0f4af7e 100644 --- a/cpu/stm32_common/periph/Makefile +++ b/cpu/stm32_common/periph/Makefile @@ -1,5 +1,18 @@ MODULE = stm32_common_periph -include $(RIOTCPU)/stm32_common/Makefile.dep +# Select the specific implementation for `periph_i2c` +ifneq (,$(filter periph_i2c,$(USEMODULE))) + ifneq (,$(filter $(CPU),stm32f0 stm32f3 stm32f7 stm32l0 stm32l4)) + SRC += i2c_1.c + else # stm32f1/f2/f4/l1 + SRC += i2c_2.c + endif +endif + +# flashpage and eeprom periph implementations share flash lock/unlock functions +# defined in flash_common.c +ifneq (,$(filter periph_flashpage periph_eeprom,$(USEMODULE))) + SRC += flash_common.c +endif include $(RIOTMAKE)/periph.mk diff --git a/cpu/stm32f0/Makefile.features b/cpu/stm32f0/Makefile.features index e2a50dd8655e01458a40f536415b6127a15dbb0d..d286ea06f23ab207993df550a7d7cf0e760ee7a4 100644 --- a/cpu/stm32f0/Makefile.features +++ b/cpu/stm32f0/Makefile.features @@ -1,5 +1,4 @@ ifeq (,$(filter nucleo-f031k6,$(BOARD))) - FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw endif diff --git a/cpu/stm32f1/Makefile.features b/cpu/stm32f1/Makefile.features index e5e8c0f6d8c71ef93ae9da82b80ddc934dd9d416..5e5e8b9118b419c443eed05bbce504daae169842 100644 --- a/cpu/stm32f1/Makefile.features +++ b/cpu/stm32f1/Makefile.features @@ -1,4 +1,3 @@ -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw diff --git a/cpu/stm32l0/Makefile.features b/cpu/stm32l0/Makefile.features index 5c7e361aee0902133b466163c65fe96d697a2bd3..d76642f390a2bd3b88ae026276b4bbbf3aad3daf 100644 --- a/cpu/stm32l0/Makefile.features +++ b/cpu/stm32l0/Makefile.features @@ -1,5 +1,4 @@ FEATURES_PROVIDED += periph_eeprom -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw FEATURES_PROVIDED += periph_hwrng diff --git a/cpu/stm32l1/Makefile.features b/cpu/stm32l1/Makefile.features index d93fc23829633db33c1e7399a1e747fa2e418594..e13289086a100af466ac3a1091b4415ffd9e26c7 100644 --- a/cpu/stm32l1/Makefile.features +++ b/cpu/stm32l1/Makefile.features @@ -1,5 +1,4 @@ FEATURES_PROVIDED += periph_eeprom -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw diff --git a/cpu/stm32l4/Makefile.features b/cpu/stm32l4/Makefile.features index f4388f2759e80a0439a21c6e72c73ce656f2def1..baed9e607881f2652fda4d0201c0727ac01d2af9 100644 --- a/cpu/stm32l4/Makefile.features +++ b/cpu/stm32l4/Makefile.features @@ -1,4 +1,3 @@ -FEATURES_PROVIDED += periph_flash_common FEATURES_PROVIDED += periph_flashpage FEATURES_PROVIDED += periph_flashpage_raw FEATURES_PROVIDED += periph_hwrng