Browse Source

[kernel] enable RT_DEBUG_DEVICE by default and move weak rt_hw_dealy_us in kservice.c

Meco Man 3 years ago
parent
commit
5e9f525c41
3 changed files with 8 additions and 10 deletions
  1. 0 9
      components/libc/posix/delay/delay.c
  2. 1 1
      include/rtdebug.h
  3. 7 0
      src/kservice.c

+ 0 - 9
components/libc/posix/delay/delay.c

@@ -11,15 +11,6 @@
 #include <sys/types.h>
 #include <rtthread.h>
 #include <rthw.h>
-#define DBG_TAG    "POSIX.delay"
-#define DBG_LVL    DBG_INFO
-#include <rtdbg.h>
-
-RT_WEAK void rt_hw_us_delay(rt_uint32_t us)
-{
-    (void) us;
-    LOG_W("Please consider implementing rt_hw_us_delay() in another file.");
-}
 
 void msleep(unsigned int msecs)
 {

+ 1 - 1
include/rtdebug.h

@@ -53,7 +53,7 @@
 #endif
 
 #ifndef RT_DEBUG_DEVICE
-#define RT_DEBUG_DEVICE                0
+#define RT_DEBUG_DEVICE                1
 #endif
 
 #ifndef RT_DEBUG_INIT

+ 7 - 0
src/kservice.c

@@ -45,6 +45,13 @@ static volatile int __rt_errno;
 static rt_device_t _console_device = RT_NULL;
 #endif
 
+RT_WEAK void rt_hw_us_delay(rt_uint32_t us)
+{
+    (void) us;
+    RT_DEBUG_LOG(RT_DEBUG_DEVICE, ("rt_hw_us_delay() doesn't support for this board."
+        "Please consider implementing rt_hw_us_delay() in another file."));
+}
+
 /**
  * This function gets the global errno for the current thread.
  *