Skip to content

Commit fe169ca

Browse files
sigvartmhmbolivar-nordic
authored andcommitted
[nrf fromtree] dfu: boot: Add implementation for multi-image ...
... swap type check Adds multi-image implementations for checking swap type based on image index. Upstream commit: bcbc530 Signed-off-by: Sigvart Hovland <[email protected]>
1 parent f499d29 commit fe169ca

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

include/dfu/mcuboot.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ int boot_write_img_confirmed_multi(int image_index);
204204
*/
205205
int mcuboot_swap_type(void);
206206

207+
/**
208+
* @brief Determines the action, if any, that mcuboot will take on the next
209+
* reboot.
210+
*
211+
* @param image_index Image pair index.
212+
*
213+
* @return a BOOT_SWAP_TYPE_[...] constant on success, negative errno code on
214+
* fail.
215+
*/
216+
int mcuboot_swap_type_multi(int image_index);
217+
207218

208219
/** Boot upgrade request modes */
209220
#define BOOT_UPGRADE_TEST 0

subsys/dfu/boot/mcuboot.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ int boot_read_bank_header(uint8_t area_id,
144144
return 0;
145145
}
146146

147+
int mcuboot_swap_type_multi(int image_index)
148+
{
149+
return boot_swap_type_multi(image_index);
150+
}
151+
147152
int mcuboot_swap_type(void)
148153
{
149154
#ifdef FLASH_AREA_IMAGE_SECONDARY

0 commit comments

Comments
 (0)