Skip to content

Commit 5fa6340

Browse files
authored
Merge pull request #21509 from benpicco/riotboot_enhance
dist/tools/riotboot_gen_hdr: don't be pedantic, add riotboot_slot_get_current_hdr()
2 parents fc2e219 + 6e55a20 commit 5fa6340

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

dist/tools/riotboot_gen_hdr/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GENHDR_SRC := $(COMMON_SRC) $(RIOT_HDR_SRC) \
1818

1919
GENHDR_HDR := $(COMMON_HDR) $(RIOT_HDR_HDR)
2020

21-
CFLAGS += -g -I. -O3 -Wall -Wextra -pedantic -std=c99
21+
CFLAGS += -g -I. -O3 -Wall -Wextra
2222

2323
ifeq ($(QUIET),1)
2424
Q=@

sys/include/riotboot/slot.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,20 @@ void riotboot_slot_jump(unsigned slot);
7171
*/
7272
const riotboot_hdr_t *riotboot_slot_get_hdr(unsigned slot);
7373

74+
/**
75+
* @brief Get header from currently running image slot
76+
*
77+
* @returns header of current image
78+
*/
79+
static inline const riotboot_hdr_t *riotboot_slot_get_current_hdr(void)
80+
{
81+
int slot = riotboot_slot_current();
82+
if (slot < 0) {
83+
return NULL;
84+
}
85+
return riotboot_slot_get_hdr(slot);
86+
}
87+
7488
/**
7589
* @brief Validate slot
7690
*

0 commit comments

Comments
 (0)