]> git.sur5r.net Git - openocd/commitdiff
flash: flash erase_address takes unsigned arguments
authorØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 9 Jun 2010 14:01:10 +0000 (16:01 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Wed, 9 Jun 2010 14:01:10 +0000 (16:01 +0200)
fixed bug where address was parsed as a signed, rather
than unsigned it.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/flash/nor/tcl.c

index b3dbd7b8e5fcacb1fb82c3f4fe12c3f4d2c24498..cf1ca4af150b349bb08ed73f7551429cd19ac60a 100644 (file)
@@ -199,8 +199,8 @@ COMMAND_HANDLER(handle_flash_erase_address_command)
 {
        struct flash_bank *p;
        int retval = ERROR_OK;
-       int address;
-       int length;
+       uint32_t address;
+       uint32_t length;
        bool do_pad = false;
        bool do_unlock = false;
        struct target *target = get_current_target(CMD_CTX);
@@ -229,8 +229,8 @@ COMMAND_HANDLER(handle_flash_erase_address_command)
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], address);
-       COMMAND_PARSE_NUMBER(int, CMD_ARGV[1], length);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], address);
+       COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], length);
 
        if (length <= 0)
        {