aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/debug.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-12 15:02:23 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-12 15:02:23 +0000
commita7ad3ace523d19be103e03f6244e0e797354fe0f (patch)
tree62234f13c1fcb3477d16f5727b60503900b87f7f /src/include/debug.h
parent48cdf91217fd6460628315a63ccc9e87de21c193 (diff)
downloadChibiOS-a7ad3ace523d19be103e03f6244e0e797354fe0f.tar.gz
ChibiOS-a7ad3ace523d19be103e03f6244e0e797354fe0f.tar.bz2
ChibiOS-a7ad3ace523d19be103e03f6244e0e797354fe0f.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@87 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/include/debug.h')
-rw-r--r--src/include/debug.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/include/debug.h b/src/include/debug.h
new file mode 100644
index 000000000..5a4f3ac44
--- /dev/null
+++ b/src/include/debug.h
@@ -0,0 +1,70 @@
+/*
+ ChibiOS/RT - Copyright (C) 2006-2007 Giovanni Di Sirio.
+
+ This file is part of ChibiOS/RT.
+
+ ChibiOS/RT is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS/RT is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @addtogroup Debug
+ * @{
+ */
+
+#ifndef _DEBUG_H_
+#define _DEBUG_H_
+
+#ifdef CH_USE_DEBUG
+
+#define TRACE_BUFFER_SIZE 1024
+
+typedef struct {
+ void *cse_slpdata;
+ t_time cse_time;
+ UWORD16 cse_state: 4;
+ UWORD16 cse_tid: 12;
+} CtxSwcEvent;
+
+typedef struct {
+ t_size tb_size;
+ CtxSwcEvent *tb_ptr;
+ CtxSwcEvent tb_buffer[TRACE_BUFFER_SIZE];
+} TraceBuffer;
+
+extern CtxSwcEvent *dbgnext;
+extern TraceBuffer dbgtb;
+extern char *dbglastmsg;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ void chDbgInit(void);
+ void chDbgTrace(Thread *otp, Thread *ntp);
+ void chDbgPuts(char *msg);
+ void chDbgPanic(char *msg);
+#ifdef __cplusplus
+}
+#endif
+
+#else /* CH_USE_DEBUG */
+
+#define chDbgInit()
+#define chDbgPuts(msg) {}
+#define chDbgPanic(msg) {}
+
+#endif /* CH_USE_DEBUG */
+
+#endif /* _DEBUG_H_ */
+
+/** @} */