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 adds a
access_banks
helper to theFlashExt
, which is a middle ground betweenaccess_bank1
andsplit
.Problem
Right now the only way to access bank 2 is using the
split
method, which consumes theFLASH
instance. In my usecase I want to access both flash banks but I also need to flip the banks at some point, so I need to have access to the option control register viaFLASH::optcr(&self)
, which needs theFLASH
instance.Solution
Using the new
access_banks
helper I can keep theFLASH
instance around and get access to both banks as well as the option control register when I need it.