File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2626
2727- Ignore default enumeratedValues.
2828
29+ - Bring ` generic ` module into scope in ` lib.rs ` when using ` -g ` option.
30+
2931### Changed
3032
3133- [ breaking-change] remove ` Variant<U, ENUM_A> ` , use ` Option<ENUM_A> ` instead
Original file line number Diff line number Diff line change @@ -146,6 +146,13 @@ pub fn render(
146146 let generic_file = std:: str:: from_utf8 ( include_bytes ! ( "generic.rs" ) ) ?;
147147 if generic_mod {
148148 writeln ! ( File :: create( "generic.rs" ) ?, "{}" , generic_file) ?;
149+
150+ out. extend ( quote ! {
151+ #[ allow( unused_imports) ]
152+ use generic:: * ;
153+ ///Common register and bit access and modify traits
154+ pub mod generic;
155+ } ) ;
149156 } else {
150157 let tokens = syn:: parse_file ( generic_file) ?. into_token_stream ( ) ;
151158
Original file line number Diff line number Diff line change 2626//!
2727//! If the `--target` flag is omitted `svd2rust` assumes the target is the Cortex-M architecture.
2828//!
29+ //! If using the `--generic_mod` option, the emitted `generic.rs` needs to be moved to `src`, and
30+ //! [`form`](https://github.com/djmcgill/form) commit fcb397a or newer is required for splitting
31+ //! the emitted `lib.rs`.
32+ //!
2933//! ## target = cortex-m
3034//!
3135//! When targeting the Cortex-M architecture, `svd2rust` will generate three files in the current
You can’t perform that action at this time.
0 commit comments