File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 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/).
1212- Generated crates now contain the git commit hash and date of svd2rust
1313 compilation.
1414
15+ - Provide an associated const ptr ` PTR ` per peripheral RegisterBlock
16+
1517### Fixed
1618
1719- Keyword sanitizing (` async ` )
Original file line number Diff line number Diff line change @@ -59,10 +59,13 @@ pub fn render(
5959 unsafe impl Send for #name_pc { }
6060
6161 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
6366 #[ inline( always) ]
6467 pub const fn ptr( ) -> * const #base:: RegisterBlock {
65- #address as * const _
68+ Self :: PTR
6669 }
6770 }
6871
@@ -71,7 +74,7 @@ pub fn render(
7174
7275 #[ inline( always) ]
7376 fn deref( & self ) -> & Self :: Target {
74- unsafe { & * #name_pc :: ptr ( ) }
77+ unsafe { & * Self :: PTR }
7578 }
7679 }
7780 } ) ;
You can’t perform that action at this time.
0 commit comments