Skip to content
Snippets Groups Projects
Unverified Commit e0a5860b authored by cladmi's avatar cladmi
Browse files

cpu/stm32_common: remove inadapted periph_flash_common

The `periph_flash_common` feature was only defined here to trigger
inclusion of a source file with common functions.
It even only defines private symbols `_lock` and `_unlock` so no reason
to expose it to the build system.
And in practice, all stm cpus providing `periph_flashpage` or
`periph_eeprom` were required to provide `periph_flash_common` to allow
including it.

The previous implementation was only parsing in the modules were in
`FEATURES_REQUIRED` wich did not take cases of `FEATURES_OPTIONAL` into
account.
And also, in the same time, as the dependencies was declared in
`Makefile.include` it was processed before `Makefile.dep` so never handled
cases where a module could depend on `periph_flashpage` or
`periph_eeprom` feature.

It is replaced by selecting the common source file when module using it
are included.

The now useless feature `periph_flash_common` is removed from
`FEATURES_PROVIDED`.
parent d8080a66
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -9,4 +9,10 @@ ifneq (,$(filter periph_i2c,$(USEMODULE)))
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
ifeq (,$(filter nucleo-f031k6,$(BOARD)))
FEATURES_PROVIDED += periph_flash_common
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
endif
......
FEATURES_PROVIDED += periph_flash_common
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
......
FEATURES_PROVIDED += periph_eeprom
FEATURES_PROVIDED += periph_flash_common
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
FEATURES_PROVIDED += periph_hwrng
......
FEATURES_PROVIDED += periph_eeprom
FEATURES_PROVIDED += periph_flash_common
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
......
FEATURES_PROVIDED += periph_flash_common
FEATURES_PROVIDED += periph_flashpage
FEATURES_PROVIDED += periph_flashpage_raw
FEATURES_PROVIDED += periph_hwrng
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment