Skip to content

Commit 2b590ea

Browse files
bors[bot]ithinuel
andauthored
Merge #529
529: Allow multiple level of deriveFrom peripherals. r=burrbull a=ithinuel Adds an alias to the base module to allow for multiple level of `deriveFrom`. Co-authored-by: Wilfried Chauveau <[email protected]>
2 parents 4397640 + aec958a commit 2b590ea

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
## [Unreleased]
99

1010
- Support for device.x generation for riscv targets and `__EXTERNAL_INTERRUPTS` vector table
11+
- Re-export base's module for derived peripherals
1112

1213
## [v0.19.0] - 2021-05-26
1314

src/generate/peripheral.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ pub fn render(
9191
// Derived peripherals may not require re-implementation, and will instead
9292
// use a single definition of the non-derived version.
9393
if derive_regs {
94+
// re-export the base module to allow deriveFrom this one
95+
out.extend(quote! {
96+
#[doc = #description]
97+
pub use #base as #name_sc;
98+
});
9499
return Ok(out);
95100
}
96101

0 commit comments

Comments
 (0)