Skip to content

Commit 2c53934

Browse files
de-nordicnvlsianpu
authored andcommitted
zephyr/boot_serial_extension: Switch to using FIXED_PARTITION_
Switching from FLASH_AREA_ to FIXED_PARTITION_ macros. Signed-off-by: Dominik Ermel <[email protected]> Signed-off-by: Andrzej Puzdrowski <[email protected]>
1 parent 3a82b6f commit 2c53934

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

boot/zephyr/boot_serial_extensions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ static int bs_custom_storage_erase(zcbor_state_t *cs)
2828

2929
const struct flash_area *fa;
3030

31-
rc = flash_area_open(FLASH_AREA_ID(storage), &fa);
31+
rc = flash_area_open(FIXED_PARTITION_ID(storage_partition), &fa);
3232

3333
if (rc < 0) {
3434
BOOT_LOG_ERR("failed to open flash area");
3535
} else {
36-
rc = flash_area_erase(fa, 0, FLASH_AREA_SIZE(storage));
36+
rc = flash_area_erase(fa, 0, flash_area_get_size(fa));
3737
if (rc < 0) {
3838
BOOT_LOG_ERR("failed to erase flash area");
3939
}

boot/zephyr/flash_map_extended.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,18 @@ int flash_area_id_from_direct_image(int image_id)
9494
switch (image_id) {
9595
case 0:
9696
case 1:
97-
return FLASH_AREA_ID(image_0);
98-
#if DT_HAS_FIXED_PARTITION_LABEL(image_1)
97+
return FIXED_PARTITION_ID(slot0_partition);
98+
#if FIXED_PARTITION_EXISTS(slot1_partition)
9999
case 2:
100-
return FLASH_AREA_ID(image_1);
100+
return FIXED_PARTITION_ID(slot1_partition);
101101
#endif
102-
#if DT_HAS_FIXED_PARTITION_LABEL(image_2)
102+
#if FIXED_PARTITION_EXISTS(slot2_partition)
103103
case 3:
104-
return FLASH_AREA_ID(image_2);
104+
return FIXED_PARTITION_ID(slot2_partition);
105105
#endif
106-
#if DT_HAS_FIXED_PARTITION_LABEL(image_3)
106+
#if FIXED_PARTITION_EXISTS(slot3_partition)
107107
case 4:
108-
return FLASH_AREA_ID(image_3);
108+
return FIXED_PARTITION_ID(slot3_partition);
109109
#endif
110110
}
111111
return -EINVAL;

0 commit comments

Comments
 (0)