1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

sys/riotboot: provide riotboot_slot_offset()

This commit is contained in:
Kaspar Schleiser 2019-09-26 13:57:17 +02:00
parent 3e7ddcdd4c
commit 87fcd061a8
2 changed files with 10 additions and 0 deletions

View File

@ -93,6 +93,11 @@ static inline void riotboot_slot_print_hdr(unsigned slot)
riotboot_hdr_print(riotboot_slot_get_hdr(slot));
}
/**
* @brief Get the offset (in flash, in bytes) for a given slot.
*/
size_t riotboot_slot_offset(unsigned slot);
/**
* @brief Dump the addresses of all configured slots
*

View File

@ -93,3 +93,8 @@ const riotboot_hdr_t *riotboot_slot_get_hdr(unsigned slot)
return riotboot_slots[slot];
}
size_t riotboot_slot_offset(unsigned slot)
{
return (size_t)riotboot_slot_get_hdr(slot) - CPU_FLASH_BASE;
}