jtag: linuxgpiod: drop extra parenthesis
[openocd.git] / src / jtag / drivers / buspirate.c
index 0864c60b325cdae8930144ba713b0b7f145e8491..3b03337c942d59a091f6295d06ba481eba8dc9c1 100644 (file)
@@ -1,20 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 /***************************************************************************
  *   Copyright (C) 2010 by Michal Demin                                    *
  *   based on usbprog.c and arm-jtag-ew.c                                  *
  *   Several fixes by R. Diez in 2013.                                     *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -31,7 +20,7 @@
 
 #undef DEBUG_SERIAL
 /*#define DEBUG_SERIAL */
-static int buspirate_execute_queue(void);
+static int buspirate_execute_queue(struct jtag_command *cmd_queue);
 static int buspirate_init(void);
 static int buspirate_quit(void);
 static int buspirate_reset(int trst, int srst);
@@ -162,10 +151,10 @@ static int buspirate_serial_read(int fd, uint8_t *buf, int size);
 static void buspirate_serial_close(int fd);
 static void buspirate_print_buffer(uint8_t *buf, int size);
 
-static int buspirate_execute_queue(void)
+static int buspirate_execute_queue(struct jtag_command *cmd_queue)
 {
        /* currently processed command */
-       struct jtag_command *cmd = jtag_command_queue;
+       struct jtag_command *cmd = cmd_queue;
        int scan_size;
        enum scan_type type;
        uint8_t *buffer;
@@ -473,51 +462,51 @@ COMMAND_HANDLER(buspirate_handle_port_command)
 
 }
 
-static const struct command_registration buspirate_command_handlers[] = {
+static const struct command_registration buspirate_subcommand_handlers[] = {
        {
-               .name = "buspirate_adc",
+               .name = "adc",
                .handler = &buspirate_handle_adc_command,
                .mode = COMMAND_EXEC,
                .help = "reads voltages on adc pins",
                .usage = "",
        },
        {
-               .name = "buspirate_vreg",
+               .name = "vreg",
                .usage = "<1|0>",
                .handler = &buspirate_handle_vreg_command,
                .mode = COMMAND_CONFIG,
                .help = "changes the state of voltage regulators",
        },
        {
-               .name = "buspirate_pullup",
+               .name = "pullup",
                .usage = "<1|0>",
                .handler = &buspirate_handle_pullup_command,
                .mode = COMMAND_CONFIG,
                .help = "changes the state of pullup",
        },
        {
-               .name = "buspirate_led",
+               .name = "led",
                .usage = "<1|0>",
                .handler = &buspirate_handle_led_command,
                .mode = COMMAND_EXEC,
                .help = "changes the state of led",
        },
        {
-               .name = "buspirate_speed",
+               .name = "speed",
                .usage = "<normal|fast>",
                .handler = &buspirate_handle_speed_command,
                .mode = COMMAND_CONFIG,
                .help = "speed of the interface",
        },
        {
-               .name = "buspirate_mode",
+               .name = "mode",
                .usage = "<normal|open-drain>",
                .handler = &buspirate_handle_mode_command,
                .mode = COMMAND_CONFIG,
                .help = "pin mode of the interface",
        },
        {
-               .name = "buspirate_port",
+               .name = "port",
                .usage = "/dev/ttyUSB0",
                .handler = &buspirate_handle_port_command,
                .mode = COMMAND_CONFIG,
@@ -526,6 +515,17 @@ static const struct command_registration buspirate_command_handlers[] = {
        COMMAND_REGISTRATION_DONE
 };
 
+static const struct command_registration buspirate_command_handlers[] = {
+       {
+               .name = "buspirate",
+               .mode = COMMAND_ANY,
+               .help = "perform buspirate management",
+               .chain = buspirate_subcommand_handlers,
+               .usage = "",
+       },
+       COMMAND_REGISTRATION_DONE
+};
+
 static const struct swd_driver buspirate_swd = {
        .init = buspirate_swd_init,
        .switch_seq = buspirate_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)