Browse Source

[src][Kconfig]make RT_ASSERT independent of RT_USING_DEUBG

zms123456 1 year ago
parent
commit
9112dffec8
2 changed files with 6 additions and 2 deletions
  1. 2 2
      include/rtthread.h
  2. 4 0
      src/Kconfig

+ 2 - 2
include/rtthread.h

@@ -733,7 +733,7 @@ int __rt_ffs(int value);
 
 void rt_show_version(void);
 
-#ifdef RT_USING_DEBUG
+#ifdef RT_DEBUGING_ASSERT
 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);
@@ -745,7 +745,7 @@ if (!(EX))                                                                    \
 }
 #else
 #define RT_ASSERT(EX)
-#endif /* RT_USING_DEBUG */
+#endif /* RT_DEBUGING_ASSERT */
 
 #ifdef RT_DEBUGING_CONTEXT
 /* Macro to check current context */

+ 4 - 0
src/Kconfig

@@ -220,6 +220,10 @@ menuconfig RT_USING_DEBUG
     default y
 
     if RT_USING_DEBUG
+        config RT_DEBUGING_ASSERT
+            bool "Enable assertion debugging"
+            default y
+
         config RT_DEBUGING_COLOR
             bool "Enable color debugging log"
             default y