summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbernard <[email protected]>2017-01-31 13:18:20 +0800
committerbernard <[email protected]>2017-01-31 13:18:20 +0800
commit2ce73825347680c8f262a7e7dbc16c79e86acb9f (patch)
treeb36c694c1233cef952fd82b87e03429bb7d26c29 /src
parent355b926e899aac8cdfb666b4e8d79a90b827c150 (diff)
[Kernel] Add rt_kputs routine.
Diffstat (limited to 'src')
-rw-r--r--src/kservice.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/kservice.c b/src/kservice.c
index 614399e1e0..10fcfb0cf9 100644
--- a/src/kservice.c
+++ b/src/kservice.c
@@ -1108,6 +1108,31 @@ WEAK void rt_hw_console_output(const char *str)
RTM_EXPORT(rt_hw_console_output);
/**
+ * This function will put string to the console.
+ *
+ * @param str the string output to the console.
+ */
+void rt_kputs(const char *str)
+{
+#ifdef RT_USING_DEVICE
+ if (_console_device == RT_NULL)
+ {
+ rt_hw_console_output(str);
+ }
+ else
+ {
+ rt_uint16_t old_flag = _console_device->open_flag;
+
+ _console_device->open_flag |= RT_DEVICE_FLAG_STREAM;
+ rt_device_write(_console_device, 0, str, rt_strlen(str));
+ _console_device->open_flag = old_flag;
+ }
+#else
+ rt_hw_console_output(str);
+#endif
+}
+
+/**
* This function will print a formatted string on system console
*
* @param fmt the format