From 1952f7257eecfa2ec0ab0d1edb5b9ddd779073ed Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Mon, 29 Aug 2016 17:13:00 +0200 Subject: [PATCH] shell print interface implemented --- source/firmware/kernel/interface/shell.h | 1 + source/firmware/kernel/shell.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/source/firmware/kernel/interface/shell.h b/source/firmware/kernel/interface/shell.h index c242e8d..1b176ee 100644 --- a/source/firmware/kernel/interface/shell.h +++ b/source/firmware/kernel/interface/shell.h @@ -19,5 +19,6 @@ struct command { int shell_init(const struct driver *shell_device); int shell_add_command(struct command *command); +int shell_write(const char *buffer, unsigned int len); #endif /* SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_ */ diff --git a/source/firmware/kernel/shell.c b/source/firmware/kernel/shell.c index 835d31e..1a66456 100644 --- a/source/firmware/kernel/shell.c +++ b/source/firmware/kernel/shell.c @@ -96,3 +96,10 @@ int shell_add_command(struct command *command) list_add(&shell_object.command_list, &command->item); return 1; } + +int shell_write(const char *buffer, unsigned int len) +{ + if((NULL == buffer) || (NULL == shell_object.shell_device)) + return -1; + return drv_write(shell_object.shell_device, buffer, len); +}