add status command to shell

This commit is contained in:
optixx
2009-09-22 23:55:44 +02:00
parent a341e10efc
commit 1a7fb2487e
4 changed files with 431 additions and 55 deletions

View File

@@ -117,9 +117,6 @@ void boot_startup_rom(uint16_t init_delay)
_delay_ms(init_delay);
}
void banner(){
uint8_t i;
for (i=0;i<40;i++)
@@ -136,3 +133,15 @@ void banner(){
info_P(PSTR("System Hw: %s Sw: %s\n"),HW_VERSION,SW_VERSION);
}
void transaction_status(){
info_P(PSTR("\nAddr 0x%06lx\n"),usb_trans.req_addr);
info_P(PSTR("Bank 0x%02x\n"),usb_trans.req_bank);
info_P(PSTR("Banksize 0x%06lx\n"),usb_trans.req_bank_size);
info_P(PSTR("Bankcount 0x%02x\n"),usb_trans.req_bank_cnt);
info_P(PSTR("Status 0x%02x\n"),usb_trans.req_state);
info_P(PSTR("Percent %02i\n"),usb_trans.req_percent);
info_P(PSTR("TX buffer %02i\n"),usb_trans.tx_remaining);
info_P(PSTR("RX buffer %02i\n"),usb_trans.rx_remaining);
info_P(PSTR("Syncerr %02i\n"),usb_trans.sync_errors);
}

View File

@@ -28,7 +28,7 @@ void set_rom_mode();
void usb_connect();
void boot_startup_rom(uint16_t init_delay);
void banner();
void transaction_status();
#endif

View File

@@ -41,6 +41,7 @@
#include "shared_memory.h"
uint8_t command_buf[RECEIVE_BUF_LEN];
uint8_t recv_buf[RECEIVE_BUF_LEN];
@@ -194,6 +195,7 @@ enum cmds { CMD_DUMP,
CMD_SHMRESTORE,
CMD_LOADER,
CMD_RECONNECT,
CMD_STATUS,
CMD_HELP
};
@@ -213,6 +215,7 @@ uint8_t cmdlist[][CMD_HELP] PROGMEM = {
{"SHMRESTORE"},
{"LOADER"},
{"RECONNECT"},
{"STATUS"},
{"HELP"},
};
@@ -316,6 +319,8 @@ void shell_run(void)
boot_startup_rom(500);
}else if (strcmp_P((char*)t, (PGM_P)cmdlist[CMD_RECONNECT]) == 0) {
usb_connect();
}else if (strcmp_P((char*)t, (PGM_P)cmdlist[CMD_STATUS]) == 0) {
transaction_status();
}else if (strcmp_P((char*)t, (PGM_P)cmdlist[CMD_HELP]) == 0) {
shell_help();
}