-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: RFC: Preliminary work on flash_area open once. #1569
Draft
de-nordic
wants to merge
8
commits into
mcu-tools:main
Choose a base branch
from
de-nordic:flash-area-open-once
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aef9e80
flash_map_backend: Remove flash_area_id_to_multi_image_slot
de-nordic fa01b2f
zephyr: Add implementation of flash_area_get_sectors_fa
de-nordic 45865bf
nuttx: Add implementation of flash_area_get_sectors_fa
de-nordic e69fc07
mbed: Add implementation of flash_area_get_sectors_fa
de-nordic 1856529
espressif: Add implementation of flash_area_get_sectors_fa
de-nordic eb70599
cypress: Add implementation of flash_area_get_sectors_fa
de-nordic 92e0e1e
sim: Add implementation of flash_area_get_sectors_fa
de-nordic 9dfeac3
boot: RFC: WIP: Preliminary work on flash_area open-once
de-nordic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,21 @@ int flash_area_id_to_multi_image_slot(int image_index, int area_id); | |
*/ | ||
int flash_area_sector_from_off(off_t off, struct flash_sector *sector); | ||
|
||
/* Get sectors for given flash_area object. This function is similar to | ||
* flash_area_get_sectors but takes flash_area object pointer instead | ||
* of flash area identifier. | ||
* | ||
* @param fa pointer to flash_area object. | ||
* @param count in: size of array for returned sectors, out: number | ||
* of sectors filled in. | ||
* @param ret array of sectors. | ||
* | ||
* Returns 0 on success, -ERANGE when there is not enough space in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ERANGE looks wrong There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ERANGE seems appropriate here. |
||
* @p ret for sector information; other negative errno code. | ||
*/ | ||
int flash_area_get_sectors_fa(const struct flash_area *fa, uint32_t *count, | ||
struct flash_sector *ret); | ||
|
||
static inline uint32_t flash_area_get_off(const struct flash_area *fa) | ||
{ | ||
return (uint32_t)fa->fa_off; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fa_off and fa_size only seem to be used for reading, can't the fa structure be used directly instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can.