Merge pull request #407 from grissiom/misc-fix

Misc fix
This commit is contained in:
Bernard Xiong 2015-01-05 17:07:23 +08:00
commit c3515abf93
2 changed files with 5 additions and 4 deletions

View File

@ -113,7 +113,8 @@ void finsh_set_device(const char* device_name)
/* check whether it's a same device */ /* check whether it's a same device */
if (dev == shell->device) return; if (dev == shell->device) return;
/* open this device and set the new device in finsh shell */ /* open this device and set the new device in finsh shell */
if (rt_device_open(dev, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX) == RT_EOK) if (rt_device_open(dev, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX |\
RT_DEVICE_FLAG_STREAM) == RT_EOK)
{ {
if (shell->device != RT_NULL) if (shell->device != RT_NULL)
{ {

View File

@ -1114,11 +1114,11 @@ void rt_kprintf(const char *fmt, ...)
} }
else 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); rt_device_write(_console_device, 0, rt_log_buf, length);
_console_device->flag = old_flag; _console_device->open_flag = old_flag;
} }
#else #else
rt_hw_console_output(rt_log_buf); rt_hw_console_output(rt_log_buf);