From 8b585772301574534eedff72ed41bc73cbee2c26 Mon Sep 17 00:00:00 2001 From: "Man, Jianting (Meco)" <920369182@qq.com> Date: Mon, 21 Mar 2022 02:06:17 -0400 Subject: [ulog][rtc][time][bug] solve the interference when enable the ulog timestamp (#5687) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ulog] 解决ulog开启时间戳后与libc time以及rtc驱动相关函数干涉的问题 * ulog:当发生递归输出时,后续递归想要输出的内容可能会因为防范递归的判断而无法输出 因此修改输出规则,在发生递归时,采用简单的,无格式的方式直接输出。这样既保证不会发生递归输出,也可以保证递归输出的部分可以正常输出。 * [ulog] size_t->rt_size_t NULL->RT_NULL --- components/libc/compilers/common/time.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'components/libc') diff --git a/components/libc/compilers/common/time.c b/components/libc/compilers/common/time.c index 71755b8bbb..92a14e2d96 100644 --- a/components/libc/compilers/common/time.c +++ b/components/libc/compilers/common/time.c @@ -113,16 +113,14 @@ static rt_err_t get_timeval(struct timeval *tv) } else { - /* LOG_W will cause a recursive printing if ulog timestamp function is enabled */ - rt_kprintf(_WARNING_NO_RTC); + LOG_W(_WARNING_NO_RTC); return -RT_ENOSYS; } return rst; #else - /* LOG_W will cause a recursive printing if ulog timestamp function is enabled */ - rt_kprintf(_WARNING_NO_RTC); + LOG_W(_WARNING_NO_RTC); return -RT_ENOSYS; #endif /* RT_USING_RTC */ } -- cgit v1.3.1