From: Tilman Sauerbeck Date: Wed, 18 Dec 2019 07:46:46 +0000 (+0100) Subject: common: Implement nvic::system_reset(). X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=6c0118103c85227b0e7efe57aa06cbb0b0c63a85;p=gps-watch.git common: Implement nvic::system_reset(). Performs a system reset. --- 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 { + } +}