Merge pull request #5114 from armink/fix_ulog

[utilities][ulog] Increase the usec check time.
This commit is contained in:
Bernard Xiong 2021-10-11 01:53:21 +08:00 committed by GitHub
commit e0c7371b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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 */