summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZachary T Welch <zw@superlucidity.net>2009-11-20 21:00:23 -0800
committerZachary T Welch <zw@superlucidity.net>2009-11-24 21:37:33 -0800
commit9a31d66b3ff4b877d1f1125d24cbf127234f153a (patch)
tree4389625bcb9d4b141fb29d027d4a737667880a85 /src
parent339e08baa5d000b1efe8c85ddd516d0b967992b2 (diff)
downloadopenocd_libswd-9a31d66b3ff4b877d1f1125d24cbf127234f153a.tar.gz
openocd_libswd-9a31d66b3ff4b877d1f1125d24cbf127234f153a.tar.bz2
openocd_libswd-9a31d66b3ff4b877d1f1125d24cbf127234f153a.tar.xz
openocd_libswd-9a31d66b3ff4b877d1f1125d24cbf127234f153a.zip
presto: use register_commands()
Use register_commands() with command registration array.
Diffstat (limited to 'src')
-rw-r--r--src/jtag/presto.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/jtag/presto.c b/src/jtag/presto.c
index f22bd9eb..dc40750d 100644
--- a/src/jtag/presto.c
+++ b/src/jtag/presto.c
@@ -739,11 +739,20 @@ COMMAND_HANDLER(presto_handle_serial_command)
return ERROR_OK;
}
+static const struct command_registration presto_command_handlers[] = {
+ {
+ .name = "presto_serial",
+ .handler = &presto_handle_serial_command,
+ .mode = COMMAND_CONFIG,
+ .help = "configure serial port",
+ .usage = "<devname>",
+ },
+ COMMAND_REGISTRATION_DONE
+};
+
static int presto_jtag_register_commands(struct command_context *cmd_ctx)
{
- COMMAND_REGISTER(cmd_ctx, NULL, "presto_serial", presto_handle_serial_command,
- COMMAND_CONFIG, NULL);
- return ERROR_OK;
+ return register_commands(cmd_ctx, NULL, presto_command_handlers);
}
static int presto_jtag_init(void)