re-format the coding style, convert the tab to 4 spaces and make sure the line length is not longer than 80 in rtdebug.h

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2271 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
dzzxzz@gmail.com 2012-09-05 06:52:35 +00:00
parent f897cff83f
commit cd053e7737
1 changed files with 38 additions and 22 deletions

View File

@ -58,21 +58,37 @@
#define RT_DEBUG_CONTEXT_CHECK 1 #define RT_DEBUG_CONTEXT_CHECK 1
#endif #endif
#define RT_DEBUG_LOG(type,message) do { if (type) rt_kprintf message;} while (0) #define RT_DEBUG_LOG(type, message) \
do \
{ \
if (type) \
rt_kprintf message; \
} \
while (0)
#define RT_ASSERT(EX) if (!(EX)) {volatile char dummy = 0;\ #define RT_ASSERT(EX) \
rt_kprintf("(%s) assert failed at %s:%d \n", \ if (!(EX)) \
#EX, __FUNCTION__, __LINE__); while (dummy == 0);} { \
volatile char dummy = 0; \
rt_kprintf("(%s) assert failed at %s:%d \n", #EX, __FUNCTION__, __LINE__);\
while (dummy == 0); \
}
/* Macro to check current context */ /* Macro to check current context */
#if RT_DEBUG_CONTEXT_CHECK #if RT_DEBUG_CONTEXT_CHECK
#define RT_DEBUG_NOT_IN_INTERRUPT do {\ #define RT_DEBUG_NOT_IN_INTERRUPT \
do \
{ \
rt_base_t level; \ rt_base_t level; \
level = rt_hw_interrupt_disable(); \ level = rt_hw_interrupt_disable(); \
if (rt_interrupt_get_nest() != 0){\ if (rt_interrupt_get_nest() != 0) \
{ \
rt_kprintf("Function[%s] shall not used in ISR\n", __FUNCTION__); \ rt_kprintf("Function[%s] shall not used in ISR\n", __FUNCTION__); \
RT_ASSERT(0)}\ RT_ASSERT(0) \
rt_hw_interrupt_enable(level);} while (0) } \
rt_hw_interrupt_enable(level); \
} \
while (0)
#else #else
#define RT_DEBUG_NOT_IN_INTERRUPT #define RT_DEBUG_NOT_IN_INTERRUPT
#endif #endif