From 9c51d8ef1bad7614a1f23b8f4589f68d16747595 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 24 Feb 2008 20:35:03 +0000 Subject: [PATCH] Added a shell_start() function that prints out the shell prompt and a small helpful message --- apps/shell/shell.c | 12 ++++++++++-- apps/shell/shell.h | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/shell/shell.c b/apps/shell/shell.c index db1768c12..570a87b60 100644 --- a/apps/shell/shell.c +++ b/apps/shell/shell.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell.c,v 1.7 2008/02/10 12:24:43 oliverschmidt Exp $ + * $Id: shell.c,v 1.8 2008/02/24 20:35:03 adamdunkels Exp $ */ /** @@ -323,7 +323,7 @@ shell_input(char *commandline, int commandline_len) if(front_process != &shell_process) { process_exit(front_process); } - } else { + } else { if(process_is_running(front_process)) { input.data1 = commandline; input.len1 = commandline_len; @@ -511,3 +511,11 @@ shell_set_time(unsigned long seconds) time_offset = seconds - clock_time() / CLOCK_SECOND; } /*---------------------------------------------------------------------------*/ +void +shell_start(void) +{ + shell_output_str(NULL, "Contiki command shell", ""); + shell_output_str(NULL, "Type '?' and return for help", ""); + shell_prompt("Contiki> "); +} +/*---------------------------------------------------------------------------*/ diff --git a/apps/shell/shell.h b/apps/shell/shell.h index b5c35915a..12ce312a1 100644 --- a/apps/shell/shell.h +++ b/apps/shell/shell.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: shell.h,v 1.4 2008/02/08 12:49:54 oliverschmidt Exp $ + * $Id: shell.h,v 1.5 2008/02/24 20:35:03 adamdunkels Exp $ */ /** @@ -53,6 +53,8 @@ struct shell_command { void shell_init(void); +void shell_start(void); + void shell_input(char *commandline, int commandline_len); int shell_start_command(char *commandline, int commandline_len, struct shell_command *child,