diff options
Diffstat (limited to 'avr/debug.c')
-rw-r--r-- | avr/debug.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/avr/debug.c b/avr/debug.c index 251ef26..d4ae1f4 100644 --- a/avr/debug.c +++ b/avr/debug.c @@ -49,12 +49,19 @@ command_ret_t do_dump_mem(cmd_tbl_t *cmdtp, int flag, int argc, char * const arg uint32_t addr; uint32_t length = 128; - if (strchr(argv[0],'r') != NULL) + switch (argv[0][3]) { + case 'r': readhow = ram_read_buf; - else if (strchr(argv[0],'e') != NULL) + break; + case 'e': readhow = eeprom_read_buf; - else + break; + case 'f': + readhow = flash_read_buf; + break; + default: return CMD_RET_USAGE; + } /* Address is specified since argc > 1 */ addr = strtoul(argv[1], NULL, 16); |