From 6c0118103c85227b0e7efe57aa06cbb0b0c63a85 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Wed, 18 Dec 2019 08:46:46 +0100 Subject: [PATCH] common: Implement nvic::system_reset(). Performs a system reset. --- src/common/nvic.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/common/nvic.rs b/src/common/nvic.rs index 38aece3..1519f47 100644 --- a/src/common/nvic.rs +++ b/src/common/nvic.rs @@ -62,3 +62,12 @@ pub fn set_priority(irq_number: u32, priority: u32) { m }); } + +pub fn system_reset() { + let mut scb_aircr = Reg32::new(0xe000ed0c); + + scb_aircr.write(0x5fa0004); + + loop { + } +} -- 2.30.2