Update ulog.c

Use `rt_thread_self()` to determine whether the scheduler is started or not.
This commit is contained in:
Bernard Xiong 2021-04-19 06:50:58 +08:00 committed by GitHub
parent fc97cd23d8
commit 3fa35a398b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -337,7 +337,7 @@ RT_WEAK rt_size_t ulog_formater(char *log_buf, rt_uint32_t level, const char *ta
{
rt_size_t name_len = 0;
const char *thread_name = "N/A";
if (rt_thread_self()->name)
if (rt_thread_self())
{
thread_name = rt_thread_self()->name;
}