aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include/chdebug.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/include/chdebug.h')
-rw-r--r--os/rt/include/chdebug.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h
index 728d9bf35..2e4b846f3 100644
--- a/os/rt/include/chdebug.h
+++ b/os/rt/include/chdebug.h
@@ -74,7 +74,7 @@
/* Module data structures and types. */
/*===========================================================================*/
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_TRACE == TRUE) || defined(__DOXYGEN__)
/**
* @brief Trace buffer record.
*/
@@ -120,14 +120,14 @@ typedef struct {
/* Module macros. */
/*===========================================================================*/
-#if CH_DBG_SYSTEM_STATE_CHECK
+#if CH_DBG_SYSTEM_STATE_CHECK == TRUE
#define _dbg_enter_lock() (ch.dbg.lock_cnt = 1)
#define _dbg_leave_lock() (ch.dbg.lock_cnt = 0)
#endif
/* When the state checker feature is disabled then the following functions
are replaced by an empty macro.*/
-#if !CH_DBG_SYSTEM_STATE_CHECK
+#if CH_DBG_SYSTEM_STATE_CHECK == FALSE
#define _dbg_enter_lock()
#define _dbg_leave_lock()
#define _dbg_check_disable()
@@ -145,7 +145,7 @@ typedef struct {
/* When the trace feature is disabled this function is replaced by an empty
macro.*/
-#if !CH_DBG_ENABLE_TRACE
+#if CH_DBG_ENABLE_TRACE == FALSE
#define _dbg_trace(otp)
#endif
@@ -164,11 +164,15 @@ typedef struct {
* @api
*/
#if !defined(chDbgCheck)
+#if CH_DBG_ENABLE_CHECKS
#define chDbgCheck(c) do { \
- if (CH_DBG_ENABLE_CHECKS && !(c)) { \
+ if (!(c)) { \
chSysHalt(__func__); \
} \
-} while (0)
+} while (false)
+#else
+#define chDbgCheck(c)
+#endif
#endif /* !defined(chDbgCheck) */
/**
@@ -186,11 +190,15 @@ typedef struct {
* @api
*/
#if !defined(chDbgAssert)
+#if CH_DBG_ENABLE_ASSERTS == TRUE
#define chDbgAssert(c, r) do { \
- if (CH_DBG_ENABLE_ASSERTS && !(c)) { \
+ if (!(c)) { \
chSysHalt(__func__); \
} \
-} while (0)
+} while (false)
+#else
+#define chDbgAssert(c, r)
+#endif
#endif /* !defined(chDbgAssert) */
/** @} */
@@ -201,7 +209,7 @@ typedef struct {
#ifdef __cplusplus
extern "C" {
#endif
-#if CH_DBG_SYSTEM_STATE_CHECK
+#if CH_DBG_SYSTEM_STATE_CHECK == TRUE
void _dbg_check_disable(void);
void _dbg_check_suspend(void);
void _dbg_check_enable(void);
@@ -214,7 +222,7 @@ extern "C" {
void chDbgCheckClassI(void);
void chDbgCheckClassS(void);
#endif
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_TRACE == TRUE) || defined(__DOXYGEN__)
void _dbg_trace_init(void);
void _dbg_trace(thread_t *otp);
#endif