File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
1515- Provide an associated const ptr ` PTR ` per peripheral RegisterBlock
1616
17+ - Generated peripherals now implement ` core::fmt::Debug ` .
18+
1719### Fixed
1820
1921- Keyword sanitizing (` async ` )
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ pub fn render(
4040 }
4141
4242 let span = Span :: call_site ( ) ;
43- let name_pc = Ident :: new ( & p. name . to_sanitized_upper_case ( ) , span) ;
43+ let name_str = p. name . to_sanitized_upper_case ( ) ;
44+ let name_pc = Ident :: new ( & name_str, span) ;
4445 let address = util:: hex ( p. base_address as u64 ) ;
4546 let description = util:: respace ( p. description . as_ref ( ) . unwrap_or ( & p. name ) ) ;
4647
@@ -77,6 +78,12 @@ pub fn render(
7778 unsafe { & * Self :: PTR }
7879 }
7980 }
81+
82+ impl core:: fmt:: Debug for #name_pc {
83+ fn fmt( & self , f: & mut core:: fmt:: Formatter ) -> core:: fmt:: Result {
84+ f. debug_struct( #name_str) . finish( )
85+ }
86+ }
8087 } ) ;
8188
8289 // Derived peripherals may not require re-implementation, and will instead
You can’t perform that action at this time.
0 commit comments