Commit 42ad446f authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Add `flash_area_erased_val` "mock" for Zephyr

For Zephyr assume flash is always erased to 0xff. This allows backward
compatibility of the new flash erased to 0 support.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 3900001c
Loading
Loading
Loading
Loading
+6
Changes for boot/zephyr/flash_map_extended.c: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -68,3 +68,9 @@ int flash_area_sector_from_off(off_t off, struct flash_sector *sector)

    return rc;
}

uint8_t flash_area_erased_val(const struct flash_area *fap)
{
    (void)fap;
    return 0xff;
}
+6
Changes for boot/zephyr/include/flash_map_backend/flash_map_backend.h: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -58,6 +58,12 @@ int flash_area_id_from_image_slot(int slot);
 */
int flash_area_sector_from_off(off_t off, struct flash_sector *sector);

/*
 * Returns the value expected to be read when accesing any erased
 * flash byte.
 */
uint8_t flash_area_erased_val(const struct flash_area *fap);

#ifdef __cplusplus
}
#endif