mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-31 09:21:19 +01:00
Rational: the periph_common module is required by (most) other periph drivers and also during startup of the CPU/MCU to run periph_init. The latter is only required if other periph drivers are used, hence periph_common should be a depency of periph_* modules and *not* of the CPU/MCU. This PR fixes that by making periph_common a depency of periph_* and removing the explicit include in the CPU/MCU implementation.
30 lines
960 B
Makefile
30 lines
960 B
Makefile
# Define the CPU family so we can differentiate between them in the code
|
|
CFLAGS += -DCPU_FAM_$(shell echo $(CPU_FAM) | tr 'a-z-' 'A-Z_')
|
|
|
|
# Set ROM and RAM lengths according to CPU model
|
|
ifneq (,$(filter samd21g18a samd21j18a saml21j18b saml21j18a samr21e18a samr21g18a samr30g18a,$(CPU_MODEL)))
|
|
ROM_LEN ?= 0x40000
|
|
RAM_LEN ?= 0x8000
|
|
endif
|
|
ifneq (,$(filter saml10e16a saml11e16a,$(CPU_MODEL)))
|
|
ROM_LEN ?= 64K
|
|
RAM_LEN ?= 16K
|
|
endif
|
|
|
|
ROM_START_ADDR ?= 0x00000000
|
|
RAM_START_ADDR ?= 0x20000000
|
|
|
|
# this CPU implementation doesn't use CMSIS initialization
|
|
export CFLAGS += -DDONT_USE_CMSIS_INIT
|
|
export CFLAGS += -DDONT_USE_PREDEFINED_CORE_HANDLERS
|
|
export CFLAGS += -DDONT_USE_PREDEFINED_PERIPHERALS_HANDLERS
|
|
|
|
# For Cortex-M cpu we use the common cortexm.ld linker script
|
|
LINKER_SCRIPT ?= cortexm.ld
|
|
|
|
# include sam0 common periph drivers
|
|
USEMODULE += sam0_common_periph
|
|
|
|
# export the common include directory
|
|
export INCLUDES += -I$(RIOTCPU)/sam0_common/include
|