Commit bcbc5301 authored by Sigvart Hovland's avatar Sigvart Hovland Committed by Anas Nashif
Browse files

dfu: boot: Add implementation for multi-image swap type check



Adds multi-image implementations for checking swap type based on image
index.

Signed-off-by: default avatarSigvart Hovland <sigvart.hovland@nordicsemi.no>
parent 9341a3d5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -204,6 +204,17 @@ int boot_write_img_confirmed_multi(int image_index);
 */
int mcuboot_swap_type(void);

/**
 * @brief Determines the action, if any, that mcuboot will take on the next
 * reboot.
 *
 * @param image_index Image pair index.
 *
 * @return a BOOT_SWAP_TYPE_[...] constant on success, negative errno code on
 * fail.
 */
int mcuboot_swap_type_multi(int image_index);


/** Boot upgrade request modes */
#define BOOT_UPGRADE_TEST       0
+5 −0
Original line number Diff line number Diff line
@@ -144,6 +144,11 @@ int boot_read_bank_header(uint8_t area_id,
	return 0;
}

int mcuboot_swap_type_multi(int image_index)
{
	return boot_swap_type_multi(image_index);
}

int mcuboot_swap_type(void)
{
#ifdef FLASH_AREA_IMAGE_SECONDARY