@@ -7,9 +7,9 @@ use volatile_register::RW;
7
7
#[ cfg( not( armv6m) ) ]
8
8
use super :: cpuid:: CsselrCacheType ;
9
9
#[ cfg( not( armv6m) ) ]
10
- use super :: CPUID ;
11
- #[ cfg( not( armv6m) ) ]
12
10
use super :: CBP ;
11
+ #[ cfg( not( armv6m) ) ]
12
+ use super :: CPUID ;
13
13
use super :: SCB ;
14
14
15
15
/// Register block
@@ -604,13 +604,18 @@ impl SCB {
604
604
/// Initiate a system reset request to reset the MCU
605
605
pub fn system_reset ( & mut self ) -> ! {
606
606
:: asm:: dsb ( ) ;
607
- unsafe { self . aircr . modify ( |r|
608
- SCB_AIRCR_VECTKEY | // otherwise the write is ignored
607
+ unsafe {
608
+ self . aircr . modify (
609
+ |r| {
610
+ SCB_AIRCR_VECTKEY | // otherwise the write is ignored
609
611
r & SCB_AIRCR_PRIGROUP_MASK | // keep priority group unchanged
610
- SCB_AIRCR_SYSRESETREQ // set the bit
611
- ) } ;
612
+ SCB_AIRCR_SYSRESETREQ
613
+ } , // set the bit
614
+ )
615
+ } ;
612
616
:: asm:: dsb ( ) ;
613
- loop { // wait for the reset
617
+ loop {
618
+ // wait for the reset
614
619
:: asm:: nop ( ) ; // avoid rust-lang/rust#28728
615
620
}
616
621
}
@@ -632,9 +637,7 @@ impl SCB {
632
637
633
638
/// Check if PENDSVSET bit in the ICSR register is set meaning PendSV interrupt is pending
634
639
pub fn is_pendsv_pending ( ) -> bool {
635
- unsafe {
636
- ( * Self :: ptr ( ) ) . icsr . read ( ) & SCB_ICSR_PENDSVSET == SCB_ICSR_PENDSVSET
637
- }
640
+ unsafe { ( * Self :: ptr ( ) ) . icsr . read ( ) & SCB_ICSR_PENDSVSET == SCB_ICSR_PENDSVSET }
638
641
}
639
642
640
643
/// Set the PENDSVCLR bit in the ICSR register which will clear a pending PendSV interrupt
@@ -655,9 +658,7 @@ impl SCB {
655
658
/// Check if PENDSTSET bit in the ICSR register is set meaning SysTick interrupt is pending
656
659
#[ inline]
657
660
pub fn is_pendst_pending ( ) -> bool {
658
- unsafe {
659
- ( * Self :: ptr ( ) ) . icsr . read ( ) & SCB_ICSR_PENDSTSET == SCB_ICSR_PENDSTSET
660
- }
661
+ unsafe { ( * Self :: ptr ( ) ) . icsr . read ( ) & SCB_ICSR_PENDSTSET == SCB_ICSR_PENDSTSET }
661
662
}
662
663
663
664
/// Set the PENDSTCLR bit in the ICSR register which will clear a pending SysTick interrupt
0 commit comments