Commit 01dfbb62 authored by Christopher Collins's avatar Christopher Collins Committed by ccollins476ad
Browse files

Mynewt: Make PRIMARY/SECONDARY macros public

This change only affects the Mynewt port.

Prior to this commit, the `FLASH_AREA_IMAGE_{PRIMARY,SECONDARY}` macros
were private to the bootutil package (defined in `bootutil_priv.h`).
Some other packages require these symbols (e.g., the boot_serial unit
tests), so they should be made public.

This commit moves these definitions into the public `bootutil.h` header.

Signed-off-by: default avatarChristopher Collins <ccollins@apache.org>
parent 23d3c668
Loading
Loading
Loading
Loading
+5
Changes for boot/bootutil/include/bootutil/bootutil.h: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@
extern "C" {
#endif

#if defined(MCUBOOT_MYNEWT)
#define FLASH_AREA_IMAGE_PRIMARY    FLASH_AREA_IMAGE_0
#define FLASH_AREA_IMAGE_SECONDARY  FLASH_AREA_IMAGE_1
#endif

/** Attempt to boot the contents of the primary slot. */
#define BOOT_SWAP_TYPE_NONE     1

+1 −5
Changes for boot/bootutil/src/bootutil_priv.h: 1 added line, 5 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include <flash_map_backend/flash_map_backend.h>

#include "bootutil/bootutil.h"
#include "bootutil/image.h"
#include "mcuboot_config/mcuboot_config.h"

@@ -145,11 +146,6 @@ struct boot_swap_state {
#define BOOT_FLAG_IMAGE_OK              0
#define BOOT_FLAG_COPY_DONE             1

#if defined(MCUBOOT_MYNEWT)
    #define FLASH_AREA_IMAGE_PRIMARY    FLASH_AREA_IMAGE_0
    #define FLASH_AREA_IMAGE_SECONDARY  FLASH_AREA_IMAGE_1
#endif

extern const uint32_t BOOT_MAGIC_SZ;

/**