From fa9b36aff3676a897503a359314d08db8fc5a09d Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 Feb 2009 18:20:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@766 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/include/debug.h | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'src/include/debug.h') diff --git a/src/include/debug.h b/src/include/debug.h index 37400d967..ac9034a8b 100644 --- a/src/include/debug.h +++ b/src/include/debug.h @@ -27,8 +27,6 @@ #ifndef _DEBUG_H_ #define _DEBUG_H_ -#if CH_USE_DEBUG - /** * @brief Trace buffer entries. */ @@ -62,25 +60,13 @@ typedef struct { CtxSwcEvent tb_buffer[TRACE_BUFFER_SIZE]; /**< Ring buffer.*/ } TraceBuffer; -extern CtxSwcEvent *dbgnext; -extern TraceBuffer dbgtb; -extern char *dbglastmsg; - -#ifdef __cplusplus -extern "C" { -#endif - void debug_init(void); - void chDbgPanic(char *msg); -#ifdef __cplusplus -} -#endif - +#if CH_DBG_ENABLE_ASSERTS /** * 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 + * @note The condition is tested only if the @p CH_DBG_ENABLE_ASSERTS switch is * specified in @p chconf.h else the macro does nothing. */ #define chDbgAssert(c, m) { \ @@ -88,23 +74,27 @@ extern "C" { chDbgPanic(m); \ } -#else /* !CH_USE_DEBUG */ +#else /* !CH_DBG_ENABLE_ASSERTS */ -#define debug_init() #define chDbgPanic(msg) {} #define chDbgAssert(c, m) {(void)(c);} -#endif /* CH_USE_DEBUG */ +#endif /* !CH_DBG_ENABLE_ASSERTS */ -#if CH_USE_TRACE #ifdef __cplusplus extern "C" { #endif +#if CH_DBG_ENABLE_TRACE + extern TraceBuffer trace_buffer; void chDbgTrace(Thread *otp, Thread *ntp); +#endif +#if CH_DBG_ENABLE_ASSERTS + extern char *panic_msg; + void chDbgPanic(char *msg); +#endif #ifdef __cplusplus } #endif -#endif /* CH_USE_TRACE */ #endif /* _DEBUG_H_ */ -- cgit v1.2.3