Added a shell_start() function that prints out the shell prompt and a small helpful message

This commit is contained in:
adamdunkels 2008-02-24 20:35:03 +00:00
parent 33c2116f6a
commit 9c51d8ef1b
2 changed files with 13 additions and 3 deletions

View File

@ -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> ");
}
/*---------------------------------------------------------------------------*/

View File

@ -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,