Skip to content

Commit 996c252

Browse files
nashifcarlescufi
authored andcommitted
dfu: mcuboot: rename boot_swap_type> mcuboot_swap_type
This function conflicts with a function of the same name in mcuboot. This happens when building USB DFU support into mcuboot. DFU over USB uses image manager and mcuboot internals to manage images downloaded to the device. Signed-off-by: Anas Nashif <[email protected]>
1 parent 0d82116 commit 996c252

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

ext/lib/mgmt/mcumgr/cmd/img_mgmt/port/zephyr/src/zephyr_img_mgmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ img_mgmt_impl_write_image_data(unsigned int offset, const void *data,
237237
int
238238
img_mgmt_impl_swap_type(void)
239239
{
240-
switch (boot_swap_type()) {
240+
switch (mcuboot_swap_type()) {
241241
case BOOT_SWAP_TYPE_NONE:
242242
return IMG_MGMT_SWAP_TYPE_NONE;
243243
case BOOT_SWAP_TYPE_TEST:

include/dfu/mcuboot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int boot_write_img_confirmed(void);
143143
* @return a BOOT_SWAP_TYPE_[...] constant on success, negative errno code on
144144
* fail.
145145
*/
146-
int boot_swap_type(void);
146+
int mcuboot_swap_type(void);
147147

148148
/**
149149
* @brief Marks the image in slot 1 as pending. On the next reboot, the system

samples/subsys/usb/dfu/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ showing this output to the console:
8686
[MCUBOOT] [INF] boot_status_source: Image 0: magic=unset, copy_done=0xff, image_ok=0xff
8787
[MCUBOOT] [INF] boot_status_source: Scratch: magic=unset, copy_done=0xe, image_ok=0xff
8888
[MCUBOOT] [INF] boot_status_source: Boot source: slot 0
89-
[MCUBOOT] [INF] boot_swap_type: Swap type: test
89+
[MCUBOOT] [INF] mcuboot_swap_type: Swap type: test
9090
[MCUBOOT] [INF] main: Bootloader chainload address offset: 0x20000
9191
[MCUBOOT] [INF] main: Jumping to the first image slot0
9292
***** Booting Zephyr OS v1.11.0-830-g9df01813c4 *****
@@ -102,7 +102,7 @@ USB DFU sample, showing this output to the console:
102102
[MCUBOOT] [INF] boot_status_source: Image 0: magic=good, copy_done=0x1, image_ok=0xff
103103
[MCUBOOT] [INF] boot_status_source: Scratch: magic=unset, copy_done=0xe, image_ok=0xff
104104
[MCUBOOT] [INF] boot_status_source: Boot source: none
105-
[MCUBOOT] [INF] boot_swap_type: Swap type: revert
105+
[MCUBOOT] [INF] mcuboot_swap_type: Swap type: revert
106106
[MCUBOOT] [INF] main: Bootloader chainload address offset: 0x20000
107107
***** Booting Zephyr OS v1.11.0-830-g9df01813c4 *****
108108

subsys/dfu/boot/mcuboot.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static int boot_read_swap_state(u8_t bank_id, struct boot_swap_state *state)
416416
return 0;
417417
}
418418

419-
int boot_swap_type(void)
419+
int mcuboot_swap_type(void)
420420
{
421421
const struct boot_swap_table *table;
422422
struct boot_swap_state state_slot0;

0 commit comments

Comments
 (0)