summaryrefslogtreecommitdiff
path: root/src/target/arm7_9_common.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-18 05:36:18 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-18 15:51:07 -0800
commit410fab9ea8c6632da2e4967d960f66eecc7821ec (patch)
tree51f6d5146aa04bc13ea8809963f31d03b71fd3bc /src/target/arm7_9_common.c
parent75a37eb5b37386768327e9670acfedc7811d529f (diff)
downloadopenocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.gz
openocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.bz2
openocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.tar.xz
openocd_libswd-410fab9ea8c6632da2e4967d960f66eecc7821ec.zip
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.
Diffstat (limited to 'src/target/arm7_9_common.c')
-rw-r--r--src/target/arm7_9_common.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/src/target/arm7_9_common.c b/src/target/arm7_9_common.c
index 37aa0660..16c8a925 100644
--- a/src/target/arm7_9_common.c
+++ b/src/target/arm7_9_common.c
@@ -2870,20 +2870,7 @@ COMMAND_HANDLER(handle_arm7_9_dbgrq_command)
}
if (CMD_ARGC > 0)
- {
- if (strcmp("enable", CMD_ARGV[0]) == 0)
- {
- arm7_9->use_dbgrq = 1;
- }
- else if (strcmp("disable", CMD_ARGV[0]) == 0)
- {
- arm7_9->use_dbgrq = 0;
- }
- else
- {
- command_print(CMD_CTX, "usage: arm7_9 dbgrq <enable | disable>");
- }
- }
+ COMMAND_PARSE_ENABLE(CMD_ARGV[0],arm7_9->use_dbgrq);
command_print(CMD_CTX, "use of EmbeddedICE dbgrq instead of breakpoint for target halt %s", (arm7_9->use_dbgrq) ? "enabled" : "disabled");
@@ -2902,20 +2889,7 @@ COMMAND_HANDLER(handle_arm7_9_fast_memory_access_command)
}
if (CMD_ARGC > 0)
- {
- if (strcmp("enable", CMD_ARGV[0]) == 0)
- {
- arm7_9->fast_memory_access = 1;
- }
- else if (strcmp("disable", CMD_ARGV[0]) == 0)
- {
- arm7_9->fast_memory_access = 0;
- }
- else
- {
- command_print(CMD_CTX, "usage: arm7_9 fast_memory_access <enable | disable>");
- }
- }
+ COMMAND_PARSE_ENABLE(CMD_ARGV[0], arm7_9->fast_memory_access);
command_print(CMD_CTX, "fast memory access is %s", (arm7_9->fast_memory_access) ? "enabled" : "disabled");
@@ -2934,20 +2908,7 @@ COMMAND_HANDLER(handle_arm7_9_dcc_downloads_command)
}
if (CMD_ARGC > 0)
- {
- if (strcmp("enable", CMD_ARGV[0]) == 0)
- {
- arm7_9->dcc_downloads = 1;
- }
- else if (strcmp("disable", CMD_ARGV[0]) == 0)
- {
- arm7_9->dcc_downloads = 0;
- }
- else
- {
- command_print(CMD_CTX, "usage: arm7_9 dcc_downloads <enable | disable>");
- }
- }
+ COMMAND_PARSE_ENABLE(CMD_ARGV[0], arm7_9->dcc_downloads);
command_print(CMD_CTX, "dcc downloads are %s", (arm7_9->dcc_downloads) ? "enabled" : "disabled");