File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
12
12
- Generated crates now contain the git commit hash and date of svd2rust
13
13
compilation.
14
14
15
+ - Provide an associated const ptr ` PTR ` per peripheral RegisterBlock
16
+
15
17
### Fixed
16
18
17
19
- Keyword sanitizing (` async ` )
Original file line number Diff line number Diff line change @@ -59,10 +59,13 @@ pub fn render(
59
59
unsafe impl Send for #name_pc { }
60
60
61
61
impl #name_pc {
62
- ///Returns a pointer to the register block
62
+ ///Pointer to the register block
63
+ pub const PTR : * const #base:: RegisterBlock = #address as * const _;
64
+
65
+ ///Return the pointer to the register block
63
66
#[ inline( always) ]
64
67
pub const fn ptr( ) -> * const #base:: RegisterBlock {
65
- #address as * const _
68
+ Self :: PTR
66
69
}
67
70
}
68
71
@@ -71,7 +74,7 @@ pub fn render(
71
74
72
75
#[ inline( always) ]
73
76
fn deref( & self ) -> & Self :: Target {
74
- unsafe { & * #name_pc :: ptr ( ) }
77
+ unsafe { & * Self :: PTR }
75
78
}
76
79
}
77
80
} ) ;
You can’t perform that action at this time.
0 commit comments