Skip to content

Commit 2cb6f4b

Browse files
committed
Autoformat scb.rs by rustfmt
1 parent fac7e85 commit 2cb6f4b

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/peripheral/scb.rs

+14-13
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use volatile_register::RW;
77
#[cfg(not(armv6m))]
88
use super::cpuid::CsselrCacheType;
99
#[cfg(not(armv6m))]
10-
use super::CPUID;
11-
#[cfg(not(armv6m))]
1210
use super::CBP;
11+
#[cfg(not(armv6m))]
12+
use super::CPUID;
1313
use super::SCB;
1414

1515
/// Register block
@@ -604,13 +604,18 @@ impl SCB {
604604
/// Initiate a system reset request to reset the MCU
605605
pub fn system_reset(&mut self) -> ! {
606606
::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
609611
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+
};
612616
::asm::dsb();
613-
loop { // wait for the reset
617+
loop {
618+
// wait for the reset
614619
::asm::nop(); // avoid rust-lang/rust#28728
615620
}
616621
}
@@ -632,9 +637,7 @@ impl SCB {
632637

633638
/// Check if PENDSVSET bit in the ICSR register is set meaning PendSV interrupt is pending
634639
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 }
638641
}
639642

640643
/// Set the PENDSVCLR bit in the ICSR register which will clear a pending PendSV interrupt
@@ -655,9 +658,7 @@ impl SCB {
655658
/// Check if PENDSTSET bit in the ICSR register is set meaning SysTick interrupt is pending
656659
#[inline]
657660
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 }
661662
}
662663

663664
/// Set the PENDSTCLR bit in the ICSR register which will clear a pending SysTick interrupt

0 commit comments

Comments
 (0)