Skip to content

Commit ce98d46

Browse files
committed
Separate include file for application access
1 parent 9403c71 commit ce98d46

2 files changed

Lines changed: 29 additions & 21 deletions

File tree

include/image.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,7 @@
22
#define IMAGE_H
33
#include <stdint.h>
44
#include <target.h>
5-
6-
#define IMAGE_HEADER_SIZE 256
7-
#define IMAGE_HEADER_OFFSET (2 * sizeof(uint32_t))
8-
9-
#define WOLFBOOT_MAGIC 0x464C4F57 /* WOLF */
10-
#define WOLFBOOT_MAGIC_TRAIL 0x544F4F42 /* BOOT */
11-
12-
#define HDR_END 0x00
13-
#define HDR_VERSION 0x01
14-
#define HDR_TIMESTAMP 0x02
15-
#define HDR_SHA256 0x03
16-
#define HDR_PUBKEY 0x10
17-
#define HDR_SIGNATURE 0x20
18-
#define HDR_PADDING 0xFF
19-
20-
#define PART_BOOT 0
21-
#define PART_UPDATE 1
22-
#define PART_SWAP 2
5+
#include <wolfboot/wolfboot.h>
236

247
#define IMG_STATE_NEW 0xFF
258
#define IMG_STATE_UPDATING 0x70
@@ -52,8 +35,5 @@ int wolfBoot_set_sector_flag(uint8_t part, uint8_t sector, uint8_t newflag);
5235
int wolfBoot_get_partition_state(uint8_t part, uint8_t *st);
5336
int wolfBoot_get_sector_flag(uint8_t part, uint8_t sector, uint8_t *flag);
5437
int wolfBoot_copy(uint32_t src, uint32_t dst, uint32_t size);
55-
void wolfBoot_erase_partition(uint8_t part);
56-
void wolfBoot_update_trigger(void);
57-
void wolfBoot_success(void);
5838

5939
#endif /* IMAGE_H */

include/wolfboot/wolfboot.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#ifndef WOLFBOOT_H
2+
#define WOLFBOOT_H
3+
#include <stdint.h>
4+
#include <target.h>
5+
6+
#define IMAGE_HEADER_SIZE 256
7+
#define IMAGE_HEADER_OFFSET (2 * sizeof(uint32_t))
8+
9+
#define WOLFBOOT_MAGIC 0x464C4F57 /* WOLF */
10+
#define WOLFBOOT_MAGIC_TRAIL 0x544F4F42 /* BOOT */
11+
12+
#define HDR_END 0x00
13+
#define HDR_VERSION 0x01
14+
#define HDR_TIMESTAMP 0x02
15+
#define HDR_SHA256 0x03
16+
#define HDR_PUBKEY 0x10
17+
#define HDR_SIGNATURE 0x20
18+
#define HDR_PADDING 0xFF
19+
20+
#define PART_BOOT 0
21+
#define PART_UPDATE 1
22+
#define PART_SWAP 2
23+
24+
void wolfBoot_erase_partition(uint8_t part);
25+
void wolfBoot_update_trigger(void);
26+
void wolfBoot_success(void);
27+
28+
#endif /* IMAGE_H */

0 commit comments

Comments
 (0)