Minor beautification / optmization of prompt / banner custimization.

This commit is contained in:
Oliver Schmidt 2011-05-21 20:52:00 +02:00
parent 3d9771403e
commit 8c00be1a56

View File

@ -55,17 +55,15 @@
#include <stdio.h> #include <stdio.h>
#ifdef SHELL_CONF_PROMPT #ifdef SHELL_CONF_PROMPT
extern char *shell_prompt_text; extern char shell_prompt_text[];
#define SHELL_PROMPT shell_prompt_text
#else #else
#define SHELL_PROMPT "Contiki> " static char shell_prompt_text[] = "Contiki> ";
#endif #endif
#ifdef SHELL_CONF_BANNER #ifdef SHELL_CONF_BANNER
extern char *shell_banner_text; extern char shell_banner_text[];
#define SHELL_BANNER shell_banner_text
#else #else
#define SHELL_BANNER "Contiki command shell" static char shell_banner_text[] = "Contiki command shell";
#endif #endif
LIST(commands); LIST(commands);
@ -444,7 +442,7 @@ PROCESS_THREAD(shell_process, ev, data)
PROCESS_PAUSE(); PROCESS_PAUSE();
while(1) { while(1) {
shell_prompt(SHELL_PROMPT); shell_prompt(shell_prompt_text);
PROCESS_WAIT_EVENT_UNTIL(ev == shell_event_input); PROCESS_WAIT_EVENT_UNTIL(ev == shell_event_input);
{ {
@ -564,9 +562,9 @@ shell_set_time(unsigned long seconds)
void void
shell_start(void) shell_start(void)
{ {
shell_output_str(NULL, SHELL_BANNER, ""); shell_output_str(NULL, shell_banner_text, "");
shell_output_str(NULL, "Type '?' and return for help", ""); shell_output_str(NULL, "Type '?' and return for help", "");
shell_prompt(SHELL_PROMPT); shell_prompt(shell_prompt_text);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void