summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguo <[email protected]>2022-03-27 00:53:23 +0800
committerGitHub <[email protected]>2022-03-27 00:53:23 +0800
commit2ad6e28237086ccee8fcfcecdac16b6a489bfce8 (patch)
tree434916c4827134bbc1ebbbddcf53304ab0936938
parentbae1be0f45bbc8ca974413930a3024946d88990f (diff)
Fixed the issue LOG_HEX no output at asyn mode. (#5721)
-rw-r--r--components/utilities/ulog/ulog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/utilities/ulog/ulog.c b/components/utilities/ulog/ulog.c
index 4bf106c8d9..f8f11aaf78 100644
--- a/components/utilities/ulog/ulog.c
+++ b/components/utilities/ulog/ulog.c
@@ -753,6 +753,13 @@ void ulog_hexdump(const char *tag, rt_size_t width, rt_uint8_t *buf, rt_size_t s
}
#endif /* ULOG_USING_FILTER */
+#ifdef ULOG_USING_ASYNC_OUTPUT
+ if (ulog.async_rb == RT_NULL)
+ {
+ ulog.async_rb = rt_ringbuffer_create(ULOG_ASYNC_OUTPUT_BUF_SIZE);
+ }
+#endif
+
/* get log buffer */
log_buf = get_log_buf();