|
|
@@ -1175,7 +1175,7 @@ void rt_kputs(const char *str)
|
|
|
|
|
|
_console_device->open_flag |= RT_DEVICE_FLAG_STREAM;
|
|
|
rt_device_write(_console_device, 0, str, rt_strlen(str));
|
|
|
- _console_device->open_flag = old_flag;
|
|
|
+ _console_device->open_flag ^= (~old_flag & RT_DEVICE_FLAG_STREAM);
|
|
|
}
|
|
|
#else
|
|
|
rt_hw_console_output(str);
|
|
|
@@ -1213,7 +1213,7 @@ void rt_kprintf(const char *fmt, ...)
|
|
|
|
|
|
_console_device->open_flag |= RT_DEVICE_FLAG_STREAM;
|
|
|
rt_device_write(_console_device, 0, rt_log_buf, length);
|
|
|
- _console_device->open_flag = old_flag;
|
|
|
+ _console_device->open_flag ^= (~old_flag & RT_DEVICE_FLAG_STREAM);
|
|
|
}
|
|
|
#else
|
|
|
rt_hw_console_output(rt_log_buf);
|