提交 4373ef2e 编写于 作者: B Bernard Xiong

[Utilities] Change the log_trace_init to auto init.

上级 709faa8d
...@@ -368,7 +368,7 @@ static rt_err_t _log_control(rt_device_t dev, rt_uint8_t cmd, void *arg) ...@@ -368,7 +368,7 @@ static rt_err_t _log_control(rt_device_t dev, rt_uint8_t cmd, void *arg)
return rt_device_control(_traceout_device, cmd, arg); return rt_device_control(_traceout_device, cmd, arg);
} }
void log_trace_init(void) int log_trace_init(void)
{ {
rt_memset(&_log_device, 0x00, sizeof(_log_device)); rt_memset(&_log_device, 0x00, sizeof(_log_device));
...@@ -385,7 +385,11 @@ void log_trace_init(void) ...@@ -385,7 +385,11 @@ void log_trace_init(void)
_log_device.tx_complete = RT_NULL; _log_device.tx_complete = RT_NULL;
rt_device_register(&_log_device, "log", RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_RDWR); rt_device_register(&_log_device, "log", RT_DEVICE_FLAG_STREAM | RT_DEVICE_FLAG_RDWR);
return ;
/* set console as default device */
_traceout_device = rt_console_get_device();
return 0;
} }
rt_device_t log_trace_get_device(void) rt_device_t log_trace_get_device(void)
......
...@@ -89,7 +89,7 @@ struct log_trace_session ...@@ -89,7 +89,7 @@ struct log_trace_session
}; };
/** initialize the log_trace system */ /** initialize the log_trace system */
void log_trace_init(void); int log_trace_init(void);
/** register a session. /** register a session.
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册