Skip to content

[utilities][ulog] Increase the usec check time. #5114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/utilities/ulog/ulog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
{
Expand All @@ -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 */
Expand Down