Improve Nvmc implementation of embedded-storage traits#374
Merged
bors[bot] merged 4 commits intonrf-rs:masterfrom Feb 4, 2022
Merged
Improve Nvmc implementation of embedded-storage traits#374bors[bot] merged 4 commits intonrf-rs:masterfrom
bors[bot] merged 4 commits intonrf-rs:masterfrom
Conversation
Contributor
|
This PR looks pretty good to me! Solves some real problems the API currently has and I would love to see it merged |
Contributor
|
This looks good, thank you! bors r+ |
Contributor
|
Build succeeded: |
|
Since some of these bugs made Nvmc pretty much impossible to use, are you planning to make a new release with these changes? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR opens a design discussion regarding the Nvmc API and implementation.
It contains the following 3 commits:
newdoesn't check that the storage is well-aligned.readconfuses offsets in the storage and offsets in the output buffer.readoutput buffer is word-aligned.readreads big-endian words regardless of the architecture.erasedoesn't check that the input is within bounds.erasedivides by 4 twice (other time is inerase_page).writedoesn't check that the input is within bounds.writeconfuses offsets in the storage and offsets in the input buffer.writewrites big-endian words regardless of the architecture.readis very complicated and seems to have other bugs.READ_SIZEis 4 instead of 1, which is unnecessarily constraining (at least for nRF52840).[u32]instead of[u8], which optimizes for writes instead of reads.READ_SIZEfrom 4 to 1 and addsNvmcError::OutOfBounds. But those changes seem needed.