Commit 2c539342 authored by Dominik Ermel's avatar Dominik Ermel Committed by Andrzej Puzdrowski
Browse files

zephyr/boot_serial_extension: Switch to using FIXED_PARTITION_



Switching from FLASH_AREA_ to FIXED_PARTITION_ macros.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: default avatarAndrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
parent 3a82b6ff
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -28,12 +28,12 @@ static int bs_custom_storage_erase(zcbor_state_t *cs)

    const struct flash_area *fa;

    rc = flash_area_open(FLASH_AREA_ID(storage), &fa);
    rc = flash_area_open(FIXED_PARTITION_ID(storage_partition), &fa);

    if (rc < 0) {
        BOOT_LOG_ERR("failed to open flash area");
    } else {
        rc = flash_area_erase(fa, 0, FLASH_AREA_SIZE(storage));
        rc = flash_area_erase(fa, 0, flash_area_get_size(fa));
        if (rc < 0) {
            BOOT_LOG_ERR("failed to erase flash area");
        }
+7 −7
Original line number Diff line number Diff line
@@ -94,18 +94,18 @@ int flash_area_id_from_direct_image(int image_id)
    switch (image_id) {
    case 0:
    case 1:
        return FLASH_AREA_ID(image_0);
#if DT_HAS_FIXED_PARTITION_LABEL(image_1)
        return FIXED_PARTITION_ID(slot0_partition);
#if FIXED_PARTITION_EXISTS(slot1_partition)
    case 2:
        return FLASH_AREA_ID(image_1);
        return FIXED_PARTITION_ID(slot1_partition);
#endif
#if DT_HAS_FIXED_PARTITION_LABEL(image_2)
#if FIXED_PARTITION_EXISTS(slot2_partition)
    case 3:
        return FLASH_AREA_ID(image_2);
        return FIXED_PARTITION_ID(slot2_partition);
#endif
#if DT_HAS_FIXED_PARTITION_LABEL(image_3)
#if FIXED_PARTITION_EXISTS(slot3_partition)
    case 4:
        return FLASH_AREA_ID(image_3);
        return FIXED_PARTITION_ID(slot3_partition);
#endif
    }
    return -EINVAL;