aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-09-25 06:37:59 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-09-25 06:37:59 +0000
commit43aa123e65ac76ee1abe0e63a459610c1f687664 (patch)
treeb7c8a1b2320c66c57889a3b059eb3cee986882bd /os
parent7262b9b8449408d64c2e6e13aca4dea0572dea7f (diff)
downloadChibiOS-43aa123e65ac76ee1abe0e63a459610c1f687664.tar.gz
ChibiOS-43aa123e65ac76ee1abe0e63a459610c1f687664.tar.bz2
ChibiOS-43aa123e65ac76ee1abe0e63a459610c1f687664.zip
Improved chSysHalt().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9795 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/nil/src/ch.c1
-rw-r--r--os/rt/src/chsys.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/os/nil/src/ch.c b/os/nil/src/ch.c
index 2a57b5401..562259913 100644
--- a/os/nil/src/ch.c
+++ b/os/nil/src/ch.c
@@ -298,6 +298,7 @@ void chSysHalt(const char *reason) {
(void)reason;
#endif
+ /* Halt hook code, usually empty.*/
CH_CFG_SYSTEM_HALT_HOOK(reason);
/* Harmless infinite loop.*/
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c
index 1d3c7eff6..715c97d74 100644
--- a/os/rt/src/chsys.c
+++ b/os/rt/src/chsys.c
@@ -193,15 +193,15 @@ void chSysHalt(const char *reason) {
port_disable();
- /* Halt hook code, usually empty.*/
- CH_CFG_SYSTEM_HALT_HOOK(reason);
-
/* Logging the event.*/
_trace_halt(reason);
/* Pointing to the passed message.*/
ch.dbg.panic_msg = reason;
+ /* Halt hook code, usually empty.*/
+ CH_CFG_SYSTEM_HALT_HOOK(reason);
+
/* Harmless infinite loop.*/
while (true) {
}