Browse Source

[debug] fix the error when disable RT_USING_DEBUG

Meco Man 1 year ago
parent
commit
c1cc1332e9
1 changed files with 3 additions and 3 deletions
  1. 3 3
      include/rtthread.h

+ 3 - 3
include/rtthread.h

@@ -717,6 +717,9 @@ if (!(EX))                                                                    \
 {                                                                             \
     rt_assert_handler(#EX, __FUNCTION__, __LINE__);                           \
 }
+#else
+#define RT_ASSERT(EX)
+#endif /* RT_USING_DEBUG */
 
 #ifdef RT_DEBUGING_CONTEXT
 /* Macro to check current context */
@@ -791,9 +794,6 @@ while (0)
 #define RT_DEBUG_IN_THREAD_CONTEXT
 #define RT_DEBUG_SCHEDULER_AVAILABLE(need_check)
 #endif /* RT_DEBUGING_CONTEXT */
-#else
-#define RT_ASSERT(EX)
-#endif /* RT_USING_DEBUG */
 
 /**@}*/