]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/debug.c
return timestamp diff
[z180-stamp.git] / avr / debug.c
index 27b5329d5defdf39f9ffc8dc5e56d79f28fc3e25..d4ae1f4aa7c09c68835f0a80d5597bc00c933449 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
 #include "common.h"
 #include <stdlib.h>
 #include <string.h>
@@ -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