@@ -19,14 +19,10 @@ impl Parse for Device {
1919 . vendor_id ( tree. get_child_text_opt ( "vendorID" ) ?)
2020 . name ( tree. get_child_text ( "name" ) ?)
2121 . series ( tree. get_child_text_opt ( "series" ) ?)
22- . version ( tree. get_child_text ( "version" ) ?)
23- . description ( tree. get_child_text ( "description" ) ?)
2422 . license_text ( tree. get_child_text_opt ( "licenseText" ) ?)
2523 . cpu ( optional :: < Cpu > ( "cpu" , tree, config) ?)
2624 . header_system_filename ( tree. get_child_text_opt ( "headerSystemFilename" ) ?)
2725 . header_definitions_prefix ( tree. get_child_text_opt ( "headerDefinitionsPrefix" ) ?)
28- . address_unit_bits ( tree. get_child_u32 ( "addressUnitBits" ) ?)
29- . width ( tree. get_child_u32 ( "width" ) ?)
3026 . default_register_properties ( RegisterProperties :: parse ( tree, config) ?)
3127 . peripherals ( {
3228 let ps: Result < Vec < _ > , _ > = tree
@@ -37,6 +33,18 @@ impl Parse for Device {
3733 . collect ( ) ;
3834 ps?
3935 } ) ;
36+ if let Some ( version) = tree. get_child_text_opt ( "version" ) ? {
37+ device = device. version ( version)
38+ }
39+ if let Some ( description) = tree. get_child_text_opt ( "description" ) ? {
40+ device = device. description ( description)
41+ }
42+ if let Some ( bits) = optional :: < u32 > ( "addressUnitBits" , tree, & ( ) ) ? {
43+ device = device. address_unit_bits ( bits)
44+ }
45+ if let Some ( width) = optional :: < u32 > ( "width" , tree, & ( ) ) ? {
46+ device = device. width ( width)
47+ }
4048 if let Some ( xmlns_xs) = tree. attribute ( "xmlns:xs" ) {
4149 device = device. xmlns_xs ( xmlns_xs. to_string ( ) ) ;
4250 }
0 commit comments