@@ -19,14 +19,10 @@ impl Parse for Device {
19
19
. vendor_id ( tree. get_child_text_opt ( "vendorID" ) ?)
20
20
. name ( tree. get_child_text ( "name" ) ?)
21
21
. series ( tree. get_child_text_opt ( "series" ) ?)
22
- . version ( tree. get_child_text ( "version" ) ?)
23
- . description ( tree. get_child_text ( "description" ) ?)
24
22
. license_text ( tree. get_child_text_opt ( "licenseText" ) ?)
25
23
. cpu ( optional :: < Cpu > ( "cpu" , tree, config) ?)
26
24
. header_system_filename ( tree. get_child_text_opt ( "headerSystemFilename" ) ?)
27
25
. 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" ) ?)
30
26
. default_register_properties ( RegisterProperties :: parse ( tree, config) ?)
31
27
. peripherals ( {
32
28
let ps: Result < Vec < _ > , _ > = tree
@@ -37,6 +33,18 @@ impl Parse for Device {
37
33
. collect ( ) ;
38
34
ps?
39
35
} ) ;
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
+ }
40
48
if let Some ( xmlns_xs) = tree. attribute ( "xmlns:xs" ) {
41
49
device = device. xmlns_xs ( xmlns_xs. to_string ( ) ) ;
42
50
}
0 commit comments