jtag/drivers/cmsis-dap: Restructure commands
[openocd.git] / src / jtag / drivers / cmsis_dap.c
index 1e7a851e4bfff26bb627ce2f9efdaced1c813c6c..52e4fadeb90748bb4c36dd4e584142e38bbd9f3e 100644 (file)
@@ -2108,12 +2108,12 @@ COMMAND_HANDLER(cmsis_dap_handle_cmd_command)
 COMMAND_HANDLER(cmsis_dap_handle_vid_pid_command)
 {
        if (CMD_ARGC > MAX_USB_IDS * 2) {
-               LOG_WARNING("ignoring extra IDs in cmsis_dap_vid_pid "
+               LOG_WARNING("ignoring extra IDs in cmsis-dap vid_pid "
                        "(maximum is %d pairs)", MAX_USB_IDS);
                CMD_ARGC = MAX_USB_IDS * 2;
        }
        if (CMD_ARGC < 2 || (CMD_ARGC & 1)) {
-               LOG_WARNING("incomplete cmsis_dap_vid_pid configuration directive");
+               LOG_WARNING("incomplete cmsis-dap vid_pid configuration directive");
                if (CMD_ARGC < 2)
                        return ERROR_COMMAND_SYNTAX_ERROR;
                /* remove the incomplete trailing id */
@@ -2148,10 +2148,10 @@ COMMAND_HANDLER(cmsis_dap_handle_backend_command)
                                }
                        }
 
-                       LOG_ERROR("invalid backend argument to cmsis_dap_backend <backend>");
+                       LOG_ERROR("invalid backend argument to cmsis-dap backend <backend>");
                }
        } else {
-               LOG_ERROR("expected exactly one argument to cmsis_dap_backend <backend>");
+               LOG_ERROR("expected exactly one argument to cmsis-dap backend <backend>");
        }
 
        return ERROR_OK;
@@ -2172,27 +2172,15 @@ static const struct command_registration cmsis_dap_subcommand_handlers[] = {
                .usage = "",
                .help = "issue cmsis-dap command",
        },
-       COMMAND_REGISTRATION_DONE
-};
-
-
-static const struct command_registration cmsis_dap_command_handlers[] = {
-       {
-               .name = "cmsis-dap",
-               .mode = COMMAND_ANY,
-               .help = "perform CMSIS-DAP management",
-               .usage = "<cmd>",
-               .chain = cmsis_dap_subcommand_handlers,
-       },
        {
-               .name = "cmsis_dap_vid_pid",
+               .name = "vid_pid",
                .handler = &cmsis_dap_handle_vid_pid_command,
                .mode = COMMAND_CONFIG,
                .help = "the vendor ID and product ID of the CMSIS-DAP device",
                .usage = "(vid pid)*",
        },
        {
-               .name = "cmsis_dap_backend",
+               .name = "backend",
                .handler = &cmsis_dap_handle_backend_command,
                .mode = COMMAND_CONFIG,
                .help = "set the communication backend to use (USB bulk or HID).",
@@ -2200,7 +2188,7 @@ static const struct command_registration cmsis_dap_command_handlers[] = {
        },
 #if BUILD_CMSIS_DAP_USB
        {
-               .name = "cmsis_dap_usb",
+               .name = "usb",
                .chain = cmsis_dap_usb_subcommand_handlers,
                .mode = COMMAND_ANY,
                .help = "USB bulk backend-specific commands",
@@ -2210,6 +2198,18 @@ static const struct command_registration cmsis_dap_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+
+static const struct command_registration cmsis_dap_command_handlers[] = {
+       {
+               .name = "cmsis-dap",
+               .mode = COMMAND_ANY,
+               .help = "perform CMSIS-DAP management",
+               .usage = "<cmd>",
+               .chain = cmsis_dap_subcommand_handlers,
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 static const struct swd_driver cmsis_dap_swd_driver = {
        .init = cmsis_dap_swd_init,
        .switch_seq = cmsis_dap_swd_switch_seq,

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)