aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/include
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel/include')
-rw-r--r--os/kernel/include/chsys.h7
-rw-r--r--os/kernel/include/chthreads.h4
2 files changed, 10 insertions, 1 deletions
diff --git a/os/kernel/include/chsys.h b/os/kernel/include/chsys.h
index 2f94c5209..22396f41f 100644
--- a/os/kernel/include/chsys.h
+++ b/os/kernel/include/chsys.h
@@ -45,7 +45,14 @@
* error in the application code that triggers an assertion while
* in debug mode.
*/
+#if !defined(SYSTEM_HALT_HOOK) || defined(__DOXYGEN__)
#define chSysHalt() port_halt()
+#else
+#define chSysHalt() { \
+ SYSTEM_HALT_HOOK(); \
+ port_halt(); \
+}
+#endif
/**
* @brief Performs a context switch.
diff --git a/os/kernel/include/chthreads.h b/os/kernel/include/chthreads.h
index 1e659b768..9748166b9 100644
--- a/os/kernel/include/chthreads.h
+++ b/os/kernel/include/chthreads.h
@@ -160,8 +160,10 @@ struct Thread {
*/
void *p_mpool;
#endif
+#if defined(THREAD_EXT_FIELDS_HOOK)
/* Extra fields defined in chconf.h.*/
- THREAD_EXT_FIELDS
+ THREAD_EXT_FIELDS_HOOK
+#endif
};
/** @brief Thread state: Ready to run, waiting on the ready list.*/