1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

riotboot_slot: add second slot compatibility

When a second slot is defined, the "partition table"
gets a second field which represents the starting of
the second slot, at a defined offset.
This commit is contained in:
Francisco Acosta 2019-01-02 13:44:17 +01:00
parent 90b5865692
commit 8f22175af3
2 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,8 @@ SUBMODULES := 1
ifneq (,$(filter riotboot_slot,$(USEMODULE)))
CFLAGS += -DSLOT0_OFFSET=$(SLOT0_OFFSET)
CFLAGS += -DSLOT1_OFFSET=$(SLOT1_OFFSET)
CFLAGS += -DNUM_SLOTS=$(NUM_SLOTS)
endif
include $(RIOTBASE)/Makefile.base

View File

@ -33,6 +33,9 @@
*/
const riotboot_hdr_t * const riotboot_slots[] = {
(riotboot_hdr_t*)(CPU_FLASH_BASE + SLOT0_OFFSET), /* First slot address -> firmware image */
#if NUM_SLOTS == 2
(riotboot_hdr_t*)(CPU_FLASH_BASE + SLOT1_OFFSET), /* Second slot address -> firmware image */
#endif
};
/* Calculate the number of slots */