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:
parent
f897cff83f
commit
cd053e7737
|
@ -58,21 +58,37 @@
|
|||
#define RT_DEBUG_CONTEXT_CHECK 1
|
||||
#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;\
|
||||
rt_kprintf("(%s) assert failed at %s:%d \n", \
|
||||
#EX, __FUNCTION__, __LINE__); while (dummy == 0);}
|
||||
#define RT_ASSERT(EX) \
|
||||
if (!(EX)) \
|
||||
{ \
|
||||
volatile char dummy = 0; \
|
||||
rt_kprintf("(%s) assert failed at %s:%d \n", #EX, __FUNCTION__, __LINE__);\
|
||||
while (dummy == 0); \
|
||||
}
|
||||
|
||||
/* Macro to check current context */
|
||||
#if RT_DEBUG_CONTEXT_CHECK
|
||||
#define RT_DEBUG_NOT_IN_INTERRUPT do {\
|
||||
rt_base_t level;\
|
||||
level = rt_hw_interrupt_disable();\
|
||||
if (rt_interrupt_get_nest() != 0){\
|
||||
rt_kprintf("Function[%s] shall not used in ISR\n", __FUNCTION__);\
|
||||
RT_ASSERT(0)}\
|
||||
rt_hw_interrupt_enable(level);} while (0)
|
||||
#define RT_DEBUG_NOT_IN_INTERRUPT \
|
||||
do \
|
||||
{ \
|
||||
rt_base_t level; \
|
||||
level = rt_hw_interrupt_disable(); \
|
||||
if (rt_interrupt_get_nest() != 0) \
|
||||
{ \
|
||||
rt_kprintf("Function[%s] shall not used in ISR\n", __FUNCTION__); \
|
||||
RT_ASSERT(0) \
|
||||
} \
|
||||
rt_hw_interrupt_enable(level); \
|
||||
} \
|
||||
while (0)
|
||||
#else
|
||||
#define RT_DEBUG_NOT_IN_INTERRUPT
|
||||
#endif
|
||||
|
@ -80,7 +96,7 @@
|
|||
#else /* RT_DEBUG */
|
||||
|
||||
#define RT_ASSERT(EX)
|
||||
#define RT_DEBUG_LOG(type,message)
|
||||
#define RT_DEBUG_LOG(type, message)
|
||||
#define RT_DEBUG_NOT_IN_INTERRUPT
|
||||
|
||||
#endif /* RT_DEBUG */
|
||||
|
|
Loading…
Reference in New Issue