diff options
| author | Man, Jianting (Meco) <[email protected]> | 2023-07-21 22:36:42 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-07-22 10:36:42 +0800 |
| commit | 244b903e5def3cd4aefc4bf2ebdc4687826e2f4d (patch) | |
| tree | 8bbed859a1b5c38a449b9e2c6a35d3026eeecaef /include/rtthread.h | |
| parent | 52d3637fba5e3e4048ba036803d6292f3e7a4a70 (diff) | |
[debug] 整理debug宏并增加RT_DEBUGING_CONTEXT (#7805)
Diffstat (limited to 'include/rtthread.h')
| -rw-r--r-- | include/rtthread.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/include/rtthread.h b/include/rtthread.h index 4c0de6a511..69cec5992b 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -18,7 +18,7 @@ * 2021-11-14 Meco Man add rtlegacy.h for compatibility * 2022-06-04 Meco Man remove strnlen * 2023-05-20 Bernard add rtatomic.h header file to included files. - * 2023-06-30 ChuShicheng Move RT_DEBUG_CONTEXT_CHECK from the rtdebug.h + * 2023-06-30 ChuShicheng move debug check from the rtdebug.h */ #ifndef __RT_THREAD_H__ @@ -718,24 +718,19 @@ rt_size_t rt_strlen(const char *src); void rt_show_version(void); -#ifdef RT_DEBUG +#ifdef RT_USING_DEBUG extern void (*rt_assert_hook)(const char *ex, const char *func, rt_size_t line); void rt_assert_set_hook(void (*hook)(const char *ex, const char *func, rt_size_t line)); void rt_assert_handler(const char *ex, const char *func, rt_size_t line); -/* Turn on this to enable context check */ -#ifndef RT_DEBUG_CONTEXT_CHECK -#define RT_DEBUG_CONTEXT_CHECK 1 -#endif - #define RT_ASSERT(EX) \ if (!(EX)) \ { \ rt_assert_handler(#EX, __FUNCTION__, __LINE__); \ } +#ifdef RT_DEBUGING_CONTEXT /* Macro to check current context */ -#if RT_DEBUG_CONTEXT_CHECK #define RT_DEBUG_NOT_IN_INTERRUPT \ do \ { \ @@ -806,19 +801,14 @@ while (0) #define RT_DEBUG_NOT_IN_INTERRUPT #define RT_DEBUG_IN_THREAD_CONTEXT #define RT_DEBUG_SCHEDULER_AVAILABLE(need_check) -#endif - -#else /* RT_DEBUG */ - +#endif /* RT_DEBUGING_CONTEXT */ +#else #define RT_ASSERT(EX) -#define RT_DEBUG_NOT_IN_INTERRUPT -#define RT_DEBUG_IN_THREAD_CONTEXT -#define RT_DEBUG_SCHEDULER_AVAILABLE(need_check) -#endif /* RT_DEBUG */ +#endif /* RT_USING_DEBUG */ #ifdef RT_USING_FINSH #include <finsh.h> -#endif +#endif /* RT_USING_FINSH */ /**@}*/ @@ -826,4 +816,4 @@ while (0) } #endif -#endif +#endif /* __RT_THREAD_H__ */ |
