summaryrefslogtreecommitdiff
path: root/src/flash
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-18 05:22:44 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-18 15:51:07 -0800
commit75a37eb5b37386768327e9670acfedc7811d529f (patch)
treeebf90d39924237c0bffdce0ef2d17c124d5f2473 /src/flash
parentbd5a1799ea63c2a863eae4aca2b55e41373d7528 (diff)
downloadopenocd+libswd-75a37eb5b37386768327e9670acfedc7811d529f.tar.gz
openocd+libswd-75a37eb5b37386768327e9670acfedc7811d529f.tar.bz2
openocd+libswd-75a37eb5b37386768327e9670acfedc7811d529f.tar.xz
openocd+libswd-75a37eb5b37386768327e9670acfedc7811d529f.zip
use COMMAND_PARSE_ON_OFF where appropriate
Updates all command parsing of "on" and "off" arguments.
Diffstat (limited to 'src/flash')
-rw-r--r--src/flash/flash.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/flash/flash.c b/src/flash/flash.c
index 2c63b827..98e5ee0e 100644
--- a/src/flash/flash.c
+++ b/src/flash/flash.c
@@ -577,7 +577,6 @@ COMMAND_HANDLER(handle_flash_protect_command)
uint32_t bank_nr;
uint32_t first;
uint32_t last;
- int set;
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], bank_nr);
struct flash_bank *p = get_flash_bank_by_num(bank_nr);
@@ -590,12 +589,8 @@ COMMAND_HANDLER(handle_flash_protect_command)
else
COMMAND_PARSE_NUMBER(u32, CMD_ARGV[2], last);
- if (strcmp(CMD_ARGV[3], "on") == 0)
- set = 1;
- else if (strcmp(CMD_ARGV[3], "off") == 0)
- set = 0;
- else
- return ERROR_COMMAND_SYNTAX_ERROR;
+ bool set;
+ COMMAND_PARSE_ON_OFF(CMD_ARGV[3], set);
int retval;
if ((retval = flash_check_sector_parameters(CMD_CTX,