4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 03:33:32 +08:00

[Utilities] Change the log_trace_init to auto init.

This commit is contained in:
Bernard Xiong 2015-05-05 10:43:15 +08:00
parent 709faa8d65
commit 4373ef2e26
2 changed files with 7 additions and 3 deletions

View File

@ -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);
}
void log_trace_init(void)
int log_trace_init(void)
{
rt_memset(&_log_device, 0x00, sizeof(_log_device));
@ -385,7 +385,11 @@ void log_trace_init(void)
_log_device.tx_complete = RT_NULL;
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)

View File

@ -89,7 +89,7 @@ struct log_trace_session
};
/** initialize the log_trace system */
void log_trace_init(void);
int log_trace_init(void);
/** register a session.
*