We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68ee02d commit 480f310Copy full SHA for 480f310
src/update_flash.c
@@ -805,9 +805,11 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
805
* (UPDATING) or reverting an older image. */
806
if (st == IMG_STATE_UPDATING) {
807
inverse = 0;
808
- }
809
- else {
810
- inverse = 1;
+ } else {
+ if (cur_ver < upd_ver)
+ inverse = 1;
811
+ else
812
+ inverse = 0;
813
}
814
815
@@ -820,7 +822,7 @@ static int RAMFUNCTION wolfBoot_update(int fallback_allowed)
820
822
#ifdef EXT_FLASH
821
823
ext_flash_unlock();
824
#endif
- wolfBoot_set_partition_state(PART_UPDATE, IMG_STATE_UPDATING);
825
+ wolfBoot_set_partition_state(PART_UPDATE, IMG_STATE_NEW);
826
827
ext_flash_lock();
828
0 commit comments