This commit is contained in:
optixx 2009-09-22 22:33:44 +02:00
parent d3a48efb0b
commit 2e432cd7a7

View File

@ -193,10 +193,11 @@ enum cmds { CMD_DUMP,
CMD_SHMSAVE, CMD_SHMSAVE,
CMD_SHMRESTORE, CMD_SHMRESTORE,
CMD_LOADER, CMD_LOADER,
CMD_RECONNECT CMD_RECONNECT,
CMD_HELP
}; };
uint8_t cmdlist[][CMD_RECONNECT] PROGMEM = { uint8_t cmdlist[][CMD_HELP] PROGMEM = {
{"DUMP"}, {"DUMP"},
{"CRC"}, {"CRC"},
{"EXIT"}, {"EXIT"},
@ -212,9 +213,20 @@ uint8_t cmdlist[][CMD_RECONNECT] PROGMEM = {
{"SHMRESTORE"}, {"SHMRESTORE"},
{"LOADER"}, {"LOADER"},
{"RECONNECT"}, {"RECONNECT"},
{"HELP"},
}; };
void shell_help(void){
uint8_t i;
info_P(PSTR("\n"));
for (i=CMD_DUMP; i<CMD_HELP; i++){
info_P((PGM_P)cmdlist[i]);
info_P(PSTR("\n"));
}
}
void shell_run(void) void shell_run(void)
{ {
uint8_t *t; uint8_t *t;
@ -232,7 +244,7 @@ void shell_run(void)
t = get_token(); t = get_token();
if (t == NULL) if (t == NULL)
return; shell_help();
util_strupper(t); util_strupper(t);
@ -304,6 +316,8 @@ void shell_run(void)
boot_startup_rom(500); boot_startup_rom(500);
}else if (strcmp_P((char*)t, (PGM_P)cmdlist[CMD_RECONNECT]) == 0) { }else if (strcmp_P((char*)t, (PGM_P)cmdlist[CMD_RECONNECT]) == 0) {
usb_connect(); usb_connect();
}else if (strcmp_P((char*)t, (PGM_P)cmdlist[CMD_HELP]) == 0) {
shell_help();
} }
prompt(); prompt();