drivers/presto: Group adapter commands
authorMarc Schink <dev@zapb.de>
Fri, 30 Jul 2021 16:11:23 +0000 (18:11 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 14 Aug 2021 12:33:42 +0000 (13:33 +0100)
Use a command group 'presto' with subcommands instead of individual
commands with 'presto_' prefix.

The old commands are still available for backward compatibility but
marked as deprecated.

Change-Id: I883d8d87fd457d29cee8d12cd80f2e6c405e8f42
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6390
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
doc/openocd.texi
src/jtag/drivers/presto.c
src/jtag/startup.tcl

index 0d7719defe1c4638bba0ae422ce76180ac85a830..a9fe2906ce22c8e558a194697af0eae3be44664a 100644 (file)
@@ -3033,7 +3033,7 @@ parport cable wiggler
 
 @deffn {Interface Driver} {presto}
 ASIX PRESTO USB JTAG programmer.
-@deffn {Config Command} {presto_serial} serial_string
+@deffn {Config Command} {presto serial} serial_string
 Configures the USB serial number of the Presto device to use.
 @end deffn
 @end deffn
index b6f110be8b3d5acff5c2422d0304c41302e6a803..61de42630aee344bdbdd6edcd3f6fc84ac43a847 100644 (file)
@@ -519,9 +519,9 @@ COMMAND_HANDLER(presto_handle_serial_command)
        return ERROR_OK;
 }
 
-static const struct command_registration presto_command_handlers[] = {
+static const struct command_registration presto_subcommand_handlers[] = {
        {
-               .name = "presto_serial",
+               .name = "serial",
                .handler = presto_handle_serial_command,
                .mode = COMMAND_CONFIG,
                .help = "Configure USB serial number of Presto device.",
@@ -530,6 +530,17 @@ static const struct command_registration presto_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+static const struct command_registration presto_command_handlers[] = {
+       {
+               .name = "presto",
+               .mode = COMMAND_ANY,
+               .help = "perform presto management",
+               .chain = presto_subcommand_handlers,
+               .usage = "",
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 static int presto_jtag_init(void)
 {
        if (presto_open(presto_serial) != ERROR_OK) {
index 02a3626f4823c31803fd7e13f313afadbfcce1ac..94dbca2636789a41c72573e75fd2def43b9560a9 100644 (file)
@@ -309,4 +309,10 @@ proc parport_toggling_time args {
        eval parport toggling_time $args
 }
 
+lappend _telnet_autocomplete_skip presto_serial
+proc presto_serial args {
+       echo "DEPRECATED! use 'presto serial' not 'presto_serial'"
+       eval presto serial $args
+}
+
 # END MIGRATION AIDS