mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-03-27 09:32:28 +08:00
rt_kprintf: force the open_flag to be RT_DEVICE_FLAG_STREAM
Commit a6251a439e changed the serial device to check open_flag
instead of flag. So we should change the rt_kprintf counterpart as well.
This commit is contained in:
@@ -1114,11 +1114,11 @@ void rt_kprintf(const char *fmt, ...)
|
||||
}
|
||||
else
|
||||
{
|
||||
rt_uint16_t old_flag = _console_device->flag;
|
||||
rt_uint16_t old_flag = _console_device->open_flag;
|
||||
|
||||
_console_device->flag |= RT_DEVICE_FLAG_STREAM;
|
||||
_console_device->open_flag |= RT_DEVICE_FLAG_STREAM;
|
||||
rt_device_write(_console_device, 0, rt_log_buf, length);
|
||||
_console_device->flag = old_flag;
|
||||
_console_device->open_flag = old_flag;
|
||||
}
|
||||
#else
|
||||
rt_hw_console_output(rt_log_buf);
|
||||
|
||||
Reference in New Issue
Block a user