We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fd4547 commit c36535dCopy full SHA for c36535d
src/peripheral/scb.rs
@@ -619,6 +619,27 @@ impl SCB {
619
::asm::nop(); // avoid rust-lang/rust#28728
620
}
621
622
+
623
+ /// Initiate a system reset request to reset the MCU
624
+ ///
625
+ /// Static version of [`SCB::system_reset`].
626
+ pub fn system_reset2() -> ! {
627
+ ::asm::dsb();
628
+ unsafe {
629
+ (*Self::ptr()).aircr.modify(
630
+ |r| {
631
+ SCB_AIRCR_VECTKEY | // otherwise the write is ignored
632
+ r & SCB_AIRCR_PRIGROUP_MASK | // keep priority group unchanged
633
+ SCB_AIRCR_SYSRESETREQ
634
+ }, // set the bit
635
+ )
636
+ };
637
638
+ loop {
639
+ // wait for the reset
640
+ ::asm::nop(); // avoid rust-lang/rust#28728
641
+ }
642
643
644
645
const SCB_ICSR_PENDSVSET: u32 = 1 << 28;
0 commit comments