diff --git a/sys/include/riotboot/slot.h b/sys/include/riotboot/slot.h index f5cdb9c631..2f0ff116c7 100644 --- a/sys/include/riotboot/slot.h +++ b/sys/include/riotboot/slot.h @@ -71,6 +71,20 @@ void riotboot_slot_jump(unsigned slot); */ const riotboot_hdr_t *riotboot_slot_get_hdr(unsigned slot); +/** + * @brief Get header from currently running image slot + * + * @returns header of current image + */ +static inline const riotboot_hdr_t *riotboot_slot_get_current_hdr(void) +{ + int slot = riotboot_slot_current(); + if (slot < 0) { + return NULL; + } + return riotboot_slot_get_hdr(slot); +} + /** * @brief Validate slot *