use COMMAND_PARSE_ENABLE macro where appropriate
Updates all command parsing of simple "enable" and "disable" arguments. A few case in the tree use a tri-state or extended arguments, which cannot use this simple macro. Simlifies the xscale icache/dcache command handler logic.
This commit is contained in:
@@ -1357,12 +1357,9 @@ COMMAND_HANDLER(handle_verify_ircapture_command)
|
||||
|
||||
if (CMD_ARGC == 1)
|
||||
{
|
||||
if (strcmp(CMD_ARGV[0], "enable") == 0)
|
||||
jtag_set_verify_capture_ir(true);
|
||||
else if (strcmp(CMD_ARGV[0], "disable") == 0)
|
||||
jtag_set_verify_capture_ir(false);
|
||||
else
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
bool enable;
|
||||
COMMAND_PARSE_ENABLE(CMD_ARGV[0], enable);
|
||||
jtag_set_verify_capture_ir(enable);
|
||||
}
|
||||
|
||||
const char *status = jtag_will_verify_capture_ir() ? "enabled": "disabled";
|
||||
@@ -1378,12 +1375,9 @@ COMMAND_HANDLER(handle_verify_jtag_command)
|
||||
|
||||
if (CMD_ARGC == 1)
|
||||
{
|
||||
if (strcmp(CMD_ARGV[0], "enable") == 0)
|
||||
jtag_set_verify(true);
|
||||
else if (strcmp(CMD_ARGV[0], "disable") == 0)
|
||||
jtag_set_verify(false);
|
||||
else
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
bool enable;
|
||||
COMMAND_PARSE_ENABLE(CMD_ARGV[0], enable);
|
||||
jtag_set_verify(enable);
|
||||
}
|
||||
|
||||
const char *status = jtag_will_verify() ? "enabled": "disabled";
|
||||
|
||||
Reference in New Issue
Block a user