Skip to content

Commit f5454f1

Browse files
juser19201nordicjm
authored andcommitted
boot: bootutil: loader.c: Add check if has upgrade before pushing state change
Before pushing MCUBOOT_STATUS_UPGRADING, check if has_upgrade is true to ensure this is not pushed at every boot and only when needed. Signed-off-by: Joseph Todd <[email protected]>
1 parent 5b1c77d commit f5454f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

boot/bootutil/src/loader.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,9 @@ context_boot_go(struct boot_loader_state *state, struct boot_rsp *rsp)
22552255
#endif
22562256

22572257
/* Trigger status change callback with upgrading status */
2258-
mcuboot_status_change(MCUBOOT_STATUS_UPGRADING);
2258+
if (has_upgrade) {
2259+
mcuboot_status_change(MCUBOOT_STATUS_UPGRADING);
2260+
}
22592261

22602262
/* Iterate over all the images. At this point there are no aborted swaps
22612263
* and the swap types are determined for each image. By the end of the loop

0 commit comments

Comments
 (0)