aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/debug.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-12-03 14:54:05 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-12-03 14:54:05 +0000
commit903575815458e4e3c12195418f0582f5a9350f81 (patch)
tree08c7b5d907a8e1539a4e2f28d903e14b9c3d75ca /src/include/debug.h
parent2467527dd5297ac4f9619184608b60a550cb86dc (diff)
downloadChibiOS-903575815458e4e3c12195418f0582f5a9350f81.tar.gz
ChibiOS-903575815458e4e3c12195418f0582f5a9350f81.tar.bz2
ChibiOS-903575815458e4e3c12195418f0582f5a9350f81.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@124 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/include/debug.h')
-rw-r--r--src/include/debug.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/include/debug.h b/src/include/debug.h
index f5aed7ffe..3d763d84d 100644
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -31,6 +31,11 @@
#define TRACE_BUFFER_SIZE 64
#endif
+/**
+ * Fill value for threads working area in debug mode.
+ */
+#define MEM_FILL_PATTERN 0x55
+
typedef struct {
void *cse_slpdata;
t_time cse_time;
@@ -58,10 +63,24 @@ extern "C" {
}
#endif
+/**
+ * Condition assertion, if the condition check fails then the kernel panics
+ * with the specified message.
+ * @param c the condition to be verified to be true
+ * @param m the text message
+ * @note The condition is tested only if the \p CH_USE_DEBUG switch is
+ * specified in \p chconf.h else the macro does nothing.
+ */
+#define chDbgAssert(c, m) { \
+ if (!(c)) \
+ chDbgPanic(m); \
+}
+
#else /* CH_USE_DEBUG */
#define chDbgInit()
#define chDbgPanic(msg) {}
+#define chDbgAssert(c, m) {}
#endif /* CH_USE_DEBUG */