Skip to content

Commit e9ce67a

Browse files
committed
Unify the hdr_cpy (we don't need two)
1 parent 13bf713 commit e9ce67a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/image.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,14 @@ static uint8_t *get_sha_block(struct wolfBoot_image *img, uint32_t offset)
875875
}
876876

877877
#ifdef EXT_FLASH
878+
#ifdef UNIT_TEST
878879
static uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4);
879880
static int hdr_cpy_done = 0;
881+
#else
882+
/* use from libwolfboot.c */
883+
extern uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4);
884+
extern int hdr_cpy_done;
885+
#endif
880886

881887
/**
882888
* @brief Get a copy of the image header.

src/libwolfboot.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -904,8 +904,8 @@ uint16_t wolfBoot_find_header(uint8_t *haystack, uint16_t type, uint8_t **ptr)
904904
}
905905

906906
#ifdef EXT_FLASH
907-
static uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4);
908-
static uint32_t hdr_cpy_done = 0;
907+
uint8_t hdr_cpy[IMAGE_HEADER_SIZE] XALIGNED(4);
908+
uint32_t hdr_cpy_done = 0;
909909
#endif
910910

911911
/**
@@ -949,6 +949,10 @@ static inline uint16_t im2ns(uint16_t val)
949949
}
950950

951951
#ifdef DELTA_UPDATES
952+
953+
/* forward declaration */
954+
static uint8_t* wolfBoot_get_image_from_part(uint8_t part);
955+
952956
/**
953957
* @brief Get delta update information.
954958
*

0 commit comments

Comments
 (0)