From 5e9f525c41b6ce70662c1d0770f125de0387a5ef Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Thu, 14 Apr 2022 18:12:56 -0400 Subject: [PATCH] [kernel] enable RT_DEBUG_DEVICE by default and move weak rt_hw_dealy_us in kservice.c --- components/libc/posix/delay/delay.c | 9 --------- include/rtdebug.h | 2 +- src/kservice.c | 7 +++++++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/components/libc/posix/delay/delay.c b/components/libc/posix/delay/delay.c index 753ca48526..86d50f7e2b 100644 --- a/components/libc/posix/delay/delay.c +++ b/components/libc/posix/delay/delay.c @@ -11,15 +11,6 @@ #include #include #include -#define DBG_TAG "POSIX.delay" -#define DBG_LVL DBG_INFO -#include - -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) { diff --git a/include/rtdebug.h b/include/rtdebug.h index 9fdb4ab910..ac5ba6c1c5 100644 --- a/include/rtdebug.h +++ b/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 diff --git a/src/kservice.c b/src/kservice.c index 3c4e652c3f..ff9d3c9cef 100644 --- a/src/kservice.c +++ b/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. *