summaryrefslogtreecommitdiff
path: root/components/utilities
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2021-10-11 01:53:21 +0800
committerGitHub <[email protected]>2021-10-11 01:53:21 +0800
commite0c7371b022d944b25016626ff0fa3d80fb64779 (patch)
tree658733eafb97cbfac03218d76c3df053363d238c /components/utilities
parentb691ff389a60a79036e99e51cb80a2d2742367d9 (diff)
parent1f5a4ffe0280739a2ab938fad503f9ec22851fd4 (diff)
Merge pull request #5114 from armink/fix_ulog
[utilities][ulog] Increase the usec check time.
Diffstat (limited to 'components/utilities')
-rw-r--r--components/utilities/ulog/ulog.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c
index 8a091e9924..eab3c3a936 100644
--- a/components/utilities/ulog/ulog.c
+++ b/components/utilities/ulog/ulog.c
@@ -268,6 +268,8 @@ RT_WEAK rt_size_t ulog_formater(char *log_buf, rt_uint32_t level, const char *ta
}
#endif /* ULOG_USING_COLOR */
+ log_buf[log_len] = '\0';
+
#ifdef ULOG_OUTPUT_TIME
/* add time info */
{
@@ -288,7 +290,7 @@ RT_WEAK rt_size_t ulog_formater(char *log_buf, rt_uint32_t level, const char *ta
{
long old_usec = now.tv_usec;
/* delay some time for wait microseconds changed */
- rt_thread_delay(2);
+ rt_thread_mdelay(10);
gettimeofday(&now, NULL);
check_usec_support = RT_TRUE;
/* the microseconds is not equal between two gettimeofday calls */