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 commit takes what I believe to be the lowest maintenance approach
to sharing a common implementation between two device crates.
The common crate has a set of features that cause the underlying
svd2rust generated device crate to be imported as
target_device
.The implementation in that crate then targets
target_device
ratherthan directly using either
nrf52
ornrf523840
.This avoids littering the module with conditional code and/or macros.
The consuming hal crates re-export the items from the common crate
and augment with any other additional functionality.
One downside to this approach is that the
nrf-hal-common
crate cannotbe successfully compiled when multiple targets are built. This is
fine in practice but does mean that building in a workspace will
fail when that workspace enables multiple devices.
For that reason this commit adjusts the travis config to build the
crates individually.
Refs: jamesmunns/nrf52-hal#9