mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
riotboot: move slot variables to sys/riotboot/Makefile.include
This commit is contained in:
parent
d75c1fd76c
commit
a15f07b04b
@ -10,22 +10,8 @@ HEADER_TOOL_DIR = $(RIOTBASE)/dist/tools/riotboot_gen_hdr
|
||||
HEADER_TOOL ?= $(HEADER_TOOL_DIR)/bin/genhdr
|
||||
BINDIR_APP = $(BINDIR)/$(APPLICATION)
|
||||
|
||||
# Indicate the reserved space for a header, 256B by default
|
||||
# Notice that it must be 256B aligned. This is restricted by
|
||||
# the Cortex-M0+/3/4/7 architecture
|
||||
RIOTBOOT_HDR_LEN ?= 0x100
|
||||
|
||||
# Export variables for 'riotboot_slot'
|
||||
export SLOT0_LEN
|
||||
export SLOT1_LEN
|
||||
export NUM_SLOTS
|
||||
|
||||
# By default, slot 0 is found just after RIOTBOOT_LEN. Slot 1 after
|
||||
# slot 0. The values might be overridden to add more or less offset
|
||||
# if needed.
|
||||
export SLOT0_OFFSET ?= $(RIOTBOOT_LEN)
|
||||
# export does not work properly with variables using '$(( ))' so evaluate it in a shell
|
||||
export SLOT1_OFFSET ?= $(shell echo $$(($(SLOT0_OFFSET) + $(SLOT0_LEN))))
|
||||
#
|
||||
export SLOT0_OFFSET SLOT0_LEN SLOT1_OFFSET SLOT1_LEN
|
||||
|
||||
# Mandatory APP_VER, set to epoch by default
|
||||
APP_VER ?= $(shell date +%s)
|
||||
|
@ -88,6 +88,10 @@ ifneq (,$(filter printf_float,$(USEMODULE)))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq (,$(filter riotboot_%,$(USEMODULE)))
|
||||
include $(RIOTBASE)/sys/riotboot/Makefile.include
|
||||
endif
|
||||
|
||||
ifneq (,$(filter ssp,$(USEMODULE)))
|
||||
include $(RIOTBASE)/sys/ssp/Makefile.include
|
||||
endif
|
||||
|
@ -1,11 +1,3 @@
|
||||
SUBMODULES := 1
|
||||
|
||||
ifneq (,$(filter riotboot_slot,$(USEMODULE)))
|
||||
CFLAGS += -DSLOT0_LEN=$(SLOT0_LEN)
|
||||
CFLAGS += -DSLOT0_OFFSET=$(SLOT0_OFFSET)
|
||||
CFLAGS += -DSLOT1_LEN=$(SLOT1_LEN)
|
||||
CFLAGS += -DSLOT1_OFFSET=$(SLOT1_OFFSET)
|
||||
CFLAGS += -DNUM_SLOTS=$(NUM_SLOTS)
|
||||
endif
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
16
sys/riotboot/Makefile.include
Normal file
16
sys/riotboot/Makefile.include
Normal file
@ -0,0 +1,16 @@
|
||||
# Indicate the reserved space for a header, 256B by default
|
||||
# Notice that it must be 256B aligned. This is restricted by
|
||||
# the Cortex-M0+/3/4/7 architecture
|
||||
RIOTBOOT_HDR_LEN ?= 0x100
|
||||
|
||||
# By default, slot 0 is found just after RIOTBOOT_LEN. Slot 1 after
|
||||
# slot 0. The values might be overridden to add more or less offset
|
||||
# if needed.
|
||||
SLOT0_OFFSET ?= $(RIOTBOOT_LEN)
|
||||
SLOT1_OFFSET ?= $(shell echo $$(($(SLOT0_OFFSET) + $(SLOT0_LEN))))
|
||||
|
||||
CFLAGS += -DSLOT0_LEN=$(SLOT0_LEN)
|
||||
CFLAGS += -DSLOT0_OFFSET=$(SLOT0_OFFSET)
|
||||
CFLAGS += -DSLOT1_LEN=$(SLOT1_LEN)
|
||||
CFLAGS += -DSLOT1_OFFSET=$(SLOT1_OFFSET)
|
||||
CFLAGS += -DNUM_SLOTS=$(NUM_SLOTS)
|
Loading…
Reference in New Issue
Block a user