Skip to content

Commit 9f27a5a

Browse files
committed
sys/riotboot/slot: fix failed build
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.
1 parent 7b66eb2 commit 9f27a5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sys/include/riotboot/slot.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,10 @@ void riotboot_slot_dump_addrs(void);
116116
static inline size_t riotboot_slot_size(unsigned slot)
117117
{
118118
switch (slot) {
119+
#if NUM_SLOTS >= 1
119120
case 0:
120121
return SLOT0_LEN;
122+
#endif
121123
#if NUM_SLOTS == 2
122124
case 1:
123125
return SLOT1_LEN;

0 commit comments

Comments
 (0)