Commit 26baf2c
Merge #507
507: Emit code to bring generic module into scope when using `-g` option. r=adamgreig a=cr1901
The -g option emits a separate file called generic.rs to split the generic code from the peripherals.
Right now the -g option requires a user to manually add something like the following lines to `lib.rs`:
```rust
use generic::*;
pub mod generic;
```
Otherwise compilation will fail with errors like the following:
```sh
error[E0433]: failed to resolve: maybe a missing crate `FieldReader`?
--> src\port_1_2\p2ifg.rs:111:25
|
111 | P2IFG2_R(crate::FieldReader::new(bits))
| ^^^^^^^^^^^ maybe a missing crate `FieldReader`?
```
This patch automates adding the above code.
Co-authored-by: William D. Jones <[email protected]>3 files changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
149 | 156 | | |
150 | 157 | | |
151 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
| |||
0 commit comments