X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/fc454c83abd628f03eb39800b269d25c54f9591a..a8eb521f94848a627a3fe470e34f62b13c157d34:/avr/debug.c diff --git a/avr/debug.c b/avr/debug.c index 27b5329..d4ae1f4 100644 --- a/avr/debug.c +++ b/avr/debug.c @@ -1,3 +1,9 @@ +/* + * (C) Copyright 2014 Leo C. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + #include "common.h" #include #include @@ -7,6 +13,7 @@ #include "command.h" #include "print-utils.h" #include "debug.h" + /* * Debugging */ @@ -42,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); @@ -112,8 +126,8 @@ command_ret_t do_eep_cp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[ return CMD_RET_SUCCESS; } -/*------------------------------------------------------------------------------*/ +/*------------------------------------------------------------------------------*/ #if 1