Skip to content

Commit

Permalink
sys/riotboot/slot: fix failed build
Browse files Browse the repository at this point in the history
When riotboot/slot.h is included, but riotboot is not enabled in the
build, a compiler error occures. This is because SLOT0_LEN is not
defined. This patch fixes this by surrounding the offending macrro with
a conditional compile. `riotboot_slot_size()` may still be called, in
which case it returns 0 for the size of any slot given.
  • Loading branch information
Enoch247 committed Dec 21, 2023
1 parent 7b66eb2 commit 9f27a5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sys/include/riotboot/slot.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ void riotboot_slot_dump_addrs(void);
static inline size_t riotboot_slot_size(unsigned slot)
{
switch (slot) {
#if NUM_SLOTS >= 1
case 0:
return SLOT0_LEN;
#endif
#if NUM_SLOTS == 2
case 1:
return SLOT1_LEN;
Expand Down

0 comments on commit 9f27a5a

Please sign in to comment.