diff options
| author | Bernard Xiong <[email protected]> | 2013-10-17 15:43:56 -0700 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2013-10-17 15:43:56 -0700 |
| commit | c29ff6b0ac0456f5275e6a35c8d8ba0ee8d743c1 (patch) | |
| tree | b65f48f3edfc0c0f889d2ba716a4eef69bdeb641 /src | |
| parent | 8d5dfec3b7d934909dbb3cbe4e5ef0254a63adf3 (diff) | |
| parent | cad12ee14e5b10721c04c4c26eabdfd3167bfc17 (diff) | |
Merge pull request #161 from aozima/pulls
make sure the device is in STREAM mode when used by rt_kprintf.
Diffstat (limited to 'src')
| -rw-r--r-- | src/kservice.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/kservice.c b/src/kservice.c index c2fa43ba73..0f06806087 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -29,6 +29,7 @@ * 2012-11-23 Bernard fix IAR compiler error. * 2012-12-22 Bernard fix rt_kprintf issue, which found by Grissiom. * 2013-06-24 Bernard remove rt_kprintf if RT_USING_CONSOLE is not defined. + * 2013-09-24 aozima make sure the device is in STREAM mode when used by rt_kprintf. */ #include <rtthread.h> @@ -1125,7 +1126,11 @@ void rt_kprintf(const char *fmt, ...) } else { + rt_uint16_t old_flag = _console_device->flag; + + _console_device->flag |= RT_DEVICE_FLAG_STREAM; rt_device_write(_console_device, 0, rt_log_buf, length); + _console_device->flag = old_flag; } #else rt_hw_console_output(rt_log_buf); |
