summaryrefslogtreecommitdiff
path: root/src/flash/lpc2900.c
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 11:26:35 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:29 -0800
commit833e7f5248778bcb31b4db1a1b91160995415203 (patch)
tree7d5d5fa143b74f4989cc3226a0958e983cb1d2b5 /src/flash/lpc2900.c
parentf7e1f2df74b599903a6fb2d2ace94c3f1ef06097 (diff)
downloadopenocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.gz
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.bz2
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.tar.xz
openocd+libswd-833e7f5248778bcb31b4db1a1b91160995415203.zip
use COMMAND_REGISTER macro
Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
Diffstat (limited to 'src/flash/lpc2900.c')
-rw-r--r--src/flash/lpc2900.c54
1 files changed, 15 insertions, 39 deletions
diff --git a/src/flash/lpc2900.c b/src/flash/lpc2900.c
index 465d7768..c7f1b3a2 100644
--- a/src/flash/lpc2900.c
+++ b/src/flash/lpc2900.c
@@ -954,60 +954,36 @@ COMMAND_HANDLER(lpc2900_handle_secure_jtag_command)
*/
static int lpc2900_register_commands(struct command_context *cmd_ctx)
{
- struct command *lpc2900_cmd = register_command(cmd_ctx, NULL, "lpc2900",
+ struct command *lpc2900_cmd = COMMAND_REGISTER(cmd_ctx, NULL, "lpc2900",
NULL, COMMAND_ANY, NULL);
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "signature",
- lpc2900_handle_signature_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "signature",
+ &lpc2900_handle_signature_command, COMMAND_EXEC,
"<bank> | "
- "print device signature of flash bank");
-
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "read_custom",
- lpc2900_handle_read_custom_command,
- COMMAND_EXEC,
+ "print device signature of flash bank");
+
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "read_custom",
+ &lpc2900_handle_read_custom_command, COMMAND_EXEC,
"<bank> <filename> | "
"read customer information from index sector to file");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "password",
- lpc2900_handle_password_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "password",
+ &lpc2900_handle_password_command, COMMAND_EXEC,
"<bank> <password> | "
"enter password to enable 'dangerous' options");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "write_custom",
- lpc2900_handle_write_custom_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "write_custom",
+ &lpc2900_handle_write_custom_command, COMMAND_EXEC,
"<bank> <filename> [<type>] | "
"write customer info from file to index sector");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "secure_sector",
- lpc2900_handle_secure_sector_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "secure_sector",
+ &lpc2900_handle_secure_sector_command, COMMAND_EXEC,
"<bank> <first> <last> | "
"activate sector security for a range of sectors");
- register_command(
- cmd_ctx,
- lpc2900_cmd,
- "secure_jtag",
- lpc2900_handle_secure_jtag_command,
- COMMAND_EXEC,
+ COMMAND_REGISTER(cmd_ctx, lpc2900_cmd, "secure_jtag",
+ &lpc2900_handle_secure_jtag_command, COMMAND_EXEC,
"<bank> <level> | "
"activate JTAG security");