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

sys/riotboot: introduce riotboot_slot_other()

This commit is contained in:
Kaspar Schleiser 2019-03-13 17:21:44 +01:00
parent ae35860510
commit d75c1fd76c
2 changed files with 12 additions and 0 deletions

View File

@ -38,6 +38,13 @@ extern "C" {
*/
int riotboot_slot_current(void);
/**
* @brief Get currently not running image slot
*
* @returns nr of currently inactive slot
*/
int riotboot_slot_other(void);
/**
* @brief Get jump-to address of image slot
*

View File

@ -60,6 +60,11 @@ int riotboot_slot_current(void)
return -1;
}
int riotboot_slot_other(void)
{
return riotboot_slot_current() ? 0 : 1;
}
void riotboot_slot_jump(unsigned slot)
{
_riotboot_slot_jump_to_image(riotboot_slot_get_hdr(slot));