Skip to content

Commit aa7792c

Browse files
committed
mcuboot: Use dedicated type for slot numbers
Change bootloader request module, so it uses the new, dedicated type to point to the specific slot. Ref: NCSDK-35199 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 4441745 commit aa7792c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

modules/mcuboot/hooks/hooks_find_next_slot.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212
/**
1313
* Finds the preferred slot containing the image based on bootloader requests.
1414
*/
15-
int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image, uint32_t *active_slot)
15+
int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image,
16+
enum boot_slot *active_slot)
1617
{
1718
#ifdef CONFIG_NRF_MCUBOOT_BOOT_REQUEST
18-
uint32_t slot = BOOT_REQUEST_NO_PREFERRED_SLOT;
19+
enum boot_slot slot = BOOT_SLOT_NONE;
1920

2021
if (active_slot == NULL) {
2122
return BOOT_HOOK_REGULAR;
2223
}
2324

2425
slot = boot_request_get_preferred_slot(image);
25-
if (slot != BOOT_REQUEST_NO_PREFERRED_SLOT) {
26+
if (slot != BOOT_SLOT_NONE) {
2627
if (state->slot_usage[image].slot_available[slot]) {
2728
*active_slot = slot;
2829
return 0;

samples/dfu/ab/src/ab_utils.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ static void toggle_slot_for_single_boot(void)
162162
{
163163
int err = 0;
164164
enum ab_boot_slot active_slot = active_boot_slot_get();
165-
enum ab_boot_slot new_slot = SLOT_INVALID;
165+
enum boot_slot new_slot = BOOT_SLOT_NONE;
166166

167167
if (active_slot == SLOT_A) {
168168
LOG_INF("Temporarily switching slots (A -> B)");
169-
new_slot = SLOT_B;
169+
new_slot = BOOT_SLOT_SECONDARY;
170170
} else if (active_slot == SLOT_B) {
171171
LOG_INF("Temporarily switching slots (B -> A)");
172-
new_slot = SLOT_A;
172+
new_slot = BOOT_SLOT_PRIMARY;
173173
} else {
174174
LOG_ERR("Cannot determine active slot, cannot toggle");
175175
return;

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ manifest:
128128
compare-by-default: true
129129
- name: mcuboot
130130
repo-path: sdk-mcuboot
131-
revision: 511e742327020ebe42df2e4b45a3ca8d0f3e6611
131+
revision: 85349537b3bc4e8e9e7542abd0303adf28177dcb
132132
path: bootloader/mcuboot
133133
- name: qcbor
134134
url: https://github.com/laurencelundblade/QCBOR

0 commit comments

Comments
 (0)