summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/time.c
diff options
context:
space:
mode:
authorMan, Jianting (Meco) <[email protected]>2022-03-21 02:06:17 -0400
committerGitHub <[email protected]>2022-03-21 14:06:17 +0800
commit8b585772301574534eedff72ed41bc73cbee2c26 (patch)
tree5abc54c2e3602adaa68e9ac08e426f5e764034c7 /components/libc/compilers/common/time.c
parentfba060e5501832c67e389e0810693206ba5f7c73 (diff)
[ulog][rtc][time][bug] solve the interference when enable the ulog timestamp (#5687)
* [ulog] 解决ulog开启时间戳后与libc time以及rtc驱动相关函数干涉的问题 * ulog:当发生递归输出时,后续递归想要输出的内容可能会因为防范递归的判断而无法输出 因此修改输出规则,在发生递归时,采用简单的,无格式的方式直接输出。这样既保证不会发生递归输出,也可以保证递归输出的部分可以正常输出。 * [ulog] size_t->rt_size_t NULL->RT_NULL
Diffstat (limited to 'components/libc/compilers/common/time.c')
-rw-r--r--components/libc/compilers/common/time.c6
1 files changed, 2 insertions, 4 deletions
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 */
}