aboutsummaryrefslogtreecommitdiff
path: root/ctr-std/src
diff options
context:
space:
mode:
authorRonald Kinard <[email protected]>2017-07-31 21:25:35 -0500
committerGitHub <[email protected]>2017-07-31 21:25:35 -0500
commit776a722c83e8cd11874a9c9894decd90707361ca (patch)
tree6d85cf3d651294fe904f948c4e8be8ae919b530e /ctr-std/src
parentMerge pull request #42 from FenrirWolf/hid-update (diff)
parentTrigger reboot after panicking (diff)
downloadctru-rs-776a722c83e8cd11874a9c9894decd90707361ca.tar.xz
ctru-rs-776a722c83e8cd11874a9c9894decd90707361ca.zip
Merge pull request #41 from FenrirWolf/panic-reboot
Reboot the system after panicking
Diffstat (limited to 'ctr-std/src')
-rw-r--r--ctr-std/src/panicking.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/ctr-std/src/panicking.rs b/ctr-std/src/panicking.rs
index 8d28317..26914ce 100644
--- a/ctr-std/src/panicking.rs
+++ b/ctr-std/src/panicking.rs
@@ -111,7 +111,8 @@ pub fn begin_panic<M: Any + Send + Display>(msg: M, file_line_col: &(&'static st
let (file, line, col) = *file_line_col;
// 3DS-specific code begins here
- use libctru::{errorInit, errorText, errorDisp, svcExitProcess, threadGetCurrent,
+ use libctru::{errorInit, errorText, errorDisp,
+ APT_HardwareResetAsync, svcExitProcess, threadGetCurrent,
errorConf, errorType, CFG_Language};
use libc;
@@ -135,7 +136,10 @@ pub fn begin_panic<M: Any + Send + Display>(msg: M, file_line_col: &(&'static st
errorDisp(&mut error_conf);
// Now that we're all done printing, it's time to exit the program.
- // We don't have stack unwinding yet, so we just forcibly end the process
+ // We don't have stack unwinding yet, so let's just trigger a reboot
+ APT_HardwareResetAsync();
+
+ // If rebooting fails for some reason, we extra-forcibly end the program
svcExitProcess()
}
}