Skip to content

Commit 5bf18f4

Browse files
committed
mbed: Add implementation of flash_area_get_sectors_fa
Variant of flash_area_get_sectors that takes flash_area object pointer instead of flash area identifier. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 10badb8 commit 5bf18f4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

boot/mbed/include/flash_map_backend/flash_map_backend.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ uint8_t flash_area_erased_val(const struct flash_area * fap);
155155
*/
156156
int flash_area_get_sectors(int fa_id, uint32_t *count,
157157
struct flash_sector *sectors);
158+
int flash_area_get_sectors_fa(const struct flash_area *fa, uint32_t *count,
159+
struct flash_sector *sectors);
158160

159161

160162
int flash_area_id_from_image_slot(int slot);

boot/mbed/src/flash_map_backend.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,11 @@ int flash_area_get_sectors(int fa_id, uint32_t* count, struct flash_sector* sect
227227
return 0;
228228
}
229229

230+
int flash_area_get_sectors_fa(const struct flash_area *fap, uint32_t* count,
231+
struct flash_sector* sectors) {
232+
return flash_area_get_sectors(fap->fa_id, count, sectors);
233+
}
234+
230235
int flash_area_id_from_image_slot(int slot) {
231236
return slot;
232237
}

0 commit comments

Comments
 (0)