File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,22 @@ impl Parse for Cpu {
2020 _ => false ,
2121 } ;
2222
23+ let has_mpu_present = match tree. get_child_bool ( "mpuPresent" ) {
24+ Ok ( v) => v,
25+ _ => false ,
26+ } ;
27+
28+ let has_fpu_present = match tree. get_child_bool ( "fpuPresent" ) {
29+ Ok ( v) => v,
30+ _ => false ,
31+ } ;
32+
2333 Cpu :: builder ( )
2434 . name ( tree. get_child_text ( "name" ) ?)
2535 . revision ( tree. get_child_text ( "revision" ) ?)
2636 . endian ( Endian :: parse ( & tree. get_child_elem ( "endian" ) ?, config) ?)
27- . mpu_present ( tree . get_child_bool ( "mpuPresent" ) ? )
28- . fpu_present ( tree . get_child_bool ( "fpuPresent" ) ? )
37+ . mpu_present ( has_mpu_present )
38+ . fpu_present ( has_fpu_present )
2939 . fpu_double_precision ( optional :: < BoolParse > ( "fpuDP" , tree, & ( ) ) ?)
3040 . dsp_present ( optional :: < BoolParse > ( "dspPresent" , tree, & ( ) ) ?)
3141 . icache_present ( optional :: < BoolParse > ( "icachePresent" , tree, & ( ) ) ?)
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ fn decode_encode() {
1616 . unwrap ( ) ,
1717 "
1818 <cpu>
19- <name>EFM32JG12B500F512GM48</name>
19+ <name>EFM32JG12B500F512GM48</name>
2020 <revision>5.1.1</revision>
2121 <endian>little</endian>
2222 <mpuPresent>true</mpuPresent>
@@ -27,7 +27,7 @@ fn decode_encode() {
2727 " ,
2828 "
2929 <cpu>
30- <name>EFM32JG12B500F512GM48</name>
30+ <name>EFM32JG12B500F512GM48</name>
3131 <revision>5.1.1</revision>
3232 <endian>little</endian>
3333 <mpuPresent>true</mpuPresent>
You can’t perform that action at this time.
0 commit comments