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:
parent
90b5865692
commit
8f22175af3
@ -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
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user