Sanitize src/cmd a bit: have a src/cmd/cmd.h with extern declarations, move some apparently local functions from include/urjtag/cmd.h to src/cmd/cmd.h

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1556 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Rutger Hofman 16 years ago
parent 1c30e6ea55
commit 138b69dae3

@ -36,19 +36,11 @@
#include "types.h"
typedef struct
{
char *name;
char *desc;
void (*help) (void);
int (*run) (urj_chain_t *chain, char *params[]);
} urj_cmd_t;
extern const urj_cmd_t *urj_cmds[];
int urj_cmd_run (urj_chain_t *chain, char *params[]);
char *urj_cmd_find_next (const char *text, int state);
/* @@@@ RFHH candidate to become local in src/cmd/: */
int urj_cmd_params (char *params[]);
/* @@@@ RFHH candidate to become local in src/cmd/: */
int urj_cmd_get_number (const char *s, unsigned int *i);
int urj_cmd_test_cable (urj_chain_t *chain);
#endif /* URJ_CMD_H */

@ -92,27 +92,6 @@ jtag_create_jtagdir (void)
#ifdef HAVE_LIBREADLINE
static char *
cmd_find_next (const char *text, int state)
{
static size_t cmd_idx, len;
if (!state)
{
cmd_idx = 0;
len = strlen (text);
}
while (urj_cmds[cmd_idx])
{
char *name = urj_cmds[cmd_idx++]->name;
if (!strncmp (name, text, len))
return strdup (name);
}
return NULL;
}
#ifdef HAVE_READLINE_COMPLETION
static char **
urj_cmd_completion (const char *text, int start, int end)
@ -120,7 +99,7 @@ urj_cmd_completion (const char *text, int start, int end)
char **ret = NULL;
if (start == 0)
ret = rl_completion_matches (text, cmd_find_next);
ret = rl_completion_matches (text, urj_cmd_find_next);
return ret;
}

@ -0,0 +1,98 @@
/*
* $Id$
*
* Copyright (C) 2003 ETC s.r.o.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the ETC s.r.o. nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Written by Marcel Telka <marcel@telka.sk>, 2003.
*
*/
#ifndef URJ_SRC_CMD_H
#define URJ_SRC_CMD_H
#include <urjtag/sysdep.h>
#include <urjtag/types.h>
typedef struct
{
char *name;
char *desc;
void (*help) (void);
int (*run) (urj_chain_t *chain, char *params[]);
} urj_cmd_t;
extern const urj_cmd_t urj_cmd_quit;
extern const urj_cmd_t urj_cmd_help;
extern const urj_cmd_t urj_cmd_frequency;
extern const urj_cmd_t urj_cmd_cable;
extern const urj_cmd_t urj_cmd_reset;
extern const urj_cmd_t urj_cmd_discovery;
extern const urj_cmd_t urj_cmd_idcode;
extern const urj_cmd_t urj_cmd_detect;
extern const urj_cmd_t urj_cmd_signal;
extern const urj_cmd_t urj_cmd_scan;
extern const urj_cmd_t urj_cmd_salias;
extern const urj_cmd_t urj_cmd_bit;
extern const urj_cmd_t urj_cmd_register;
extern const urj_cmd_t urj_cmd_initbus;
extern const urj_cmd_t urj_cmd_print;
extern const urj_cmd_t urj_cmd_part;
extern const urj_cmd_t urj_cmd_bus;
extern const urj_cmd_t urj_cmd_instruction;
extern const urj_cmd_t urj_cmd_shift;
extern const urj_cmd_t urj_cmd_dr;
extern const urj_cmd_t urj_cmd_get;
extern const urj_cmd_t urj_cmd_test;
extern const urj_cmd_t urj_cmd_shell;
extern const urj_cmd_t urj_cmd_set;
extern const urj_cmd_t urj_cmd_endian;
extern const urj_cmd_t urj_cmd_peek;
extern const urj_cmd_t urj_cmd_poke;
extern const urj_cmd_t urj_cmd_pod;
extern const urj_cmd_t urj_cmd_readmem;
extern const urj_cmd_t urj_cmd_writemem;
extern const urj_cmd_t urj_cmd_detectflash;
extern const urj_cmd_t urj_cmd_flashmem;
extern const urj_cmd_t urj_cmd_eraseflash;
extern const urj_cmd_t urj_cmd_script;
extern const urj_cmd_t urj_cmd_include;
extern const urj_cmd_t urj_cmd_addpart;
extern const urj_cmd_t urj_cmd_usleep;
#ifdef ENABLE_SVF
extern const urj_cmd_t urj_cmd_svf;
#endif
#ifdef ENABLE_BSDL
extern const urj_cmd_t urj_cmd_bsdl;
#endif
extern const urj_cmd_t urj_cmd_debug;
extern const urj_cmd_t *urj_cmds[];
int urj_cmd_test_cable (urj_chain_t *chain);
#endif /* URJ_CMD_H */

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_addpart_run (urj_chain_t *chain, char *params[])
{
@ -73,7 +75,7 @@ cmd_addpart_help (void)
}
urj_cmd_t urj_cmd_addpart = {
const urj_cmd_t urj_cmd_addpart = {
"addpart",
N_("manually adds parts on the JTAG chain"),
cmd_addpart_help,

@ -32,6 +32,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static void
cmd_bit_print_params (char *params[], unsigned int parameters, char *command,
size_t command_size)
@ -187,7 +189,7 @@ cmd_bit_help (void)
"CSTATE Control state, valid state is only Z\n"), "bit");
}
urj_cmd_t urj_cmd_bit = {
const urj_cmd_t urj_cmd_bit = {
"bit",
N_("define new BSR bit"),
cmd_bit_help,

@ -32,6 +32,8 @@
#include <urjtag/chain.h>
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_bsdl_run (urj_chain_t *chain, char *params[])
{
@ -118,7 +120,7 @@ cmd_bsdl_help (void)
"bsdl", "bsdl", "bsdl", "bsdl");
}
urj_cmd_t urj_cmd_bsdl = {
const urj_cmd_t urj_cmd_bsdl = {
"bsdl",
N_("manage BSDL files"),
cmd_bsdl_help,

@ -32,6 +32,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_bus_run (urj_chain_t *chain, char *params[])
{
@ -71,7 +73,7 @@ cmd_bus_help (void)
"\n" "BUS bus number\n"), "bus");
}
urj_cmd_t urj_cmd_bus = {
const urj_cmd_t urj_cmd_bus = {
"bus",
N_("change active bus"),
cmd_bus_help,

@ -36,6 +36,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_cable_run (urj_chain_t *chain, char *params[])
{
@ -146,7 +148,7 @@ cmd_cable_help (void)
_(urj_tap_cable_drivers[i]->description));
}
urj_cmd_t urj_cmd_cable = {
const urj_cmd_t urj_cmd_cable = {
"cable",
N_("select JTAG cable"),
cmd_cable_help,

@ -31,50 +31,7 @@
#include <urjtag/cmd.h>
extern urj_cmd_t urj_cmd_quit;
extern urj_cmd_t urj_cmd_help;
extern urj_cmd_t urj_cmd_frequency;
extern urj_cmd_t urj_cmd_cable;
extern urj_cmd_t urj_cmd_reset;
extern urj_cmd_t urj_cmd_discovery;
extern urj_cmd_t urj_cmd_idcode;
extern urj_cmd_t urj_cmd_detect;
extern urj_cmd_t urj_cmd_signal;
extern urj_cmd_t urj_cmd_scan;
extern const urj_cmd_t urj_cmd_salias;
extern urj_cmd_t urj_cmd_bit;
extern urj_cmd_t urj_cmd_register;
extern const urj_cmd_t urj_cmd_initbus;
extern urj_cmd_t urj_cmd_print;
extern urj_cmd_t urj_cmd_part;
extern urj_cmd_t urj_cmd_bus;
extern urj_cmd_t urj_cmd_instruction;
extern urj_cmd_t urj_cmd_shift;
extern urj_cmd_t urj_cmd_dr;
extern urj_cmd_t urj_cmd_get;
extern urj_cmd_t urj_cmd_test;
extern urj_cmd_t urj_cmd_shell;
extern urj_cmd_t urj_cmd_set;
extern urj_cmd_t urj_cmd_endian;
extern urj_cmd_t urj_cmd_peek;
extern urj_cmd_t urj_cmd_poke;
extern urj_cmd_t urj_cmd_pod;
extern urj_cmd_t urj_cmd_readmem;
extern urj_cmd_t urj_cmd_writemem;
extern urj_cmd_t urj_cmd_detectflash;
extern urj_cmd_t urj_cmd_flashmem;
extern urj_cmd_t urj_cmd_eraseflash;
extern urj_cmd_t urj_cmd_script;
extern urj_cmd_t urj_cmd_include;
extern urj_cmd_t urj_cmd_addpart;
extern urj_cmd_t urj_cmd_usleep;
#ifdef ENABLE_SVF
extern urj_cmd_t urj_cmd_svf;
#endif
#ifdef ENABLE_BSDL
extern urj_cmd_t urj_cmd_bsdl;
#endif
extern urj_cmd_t urj_cmd_debug;
#include "cmd.h"
const urj_cmd_t *urj_cmds[] = {
&urj_cmd_quit,
@ -124,6 +81,27 @@ const urj_cmd_t *urj_cmds[] = {
NULL /* last must be NULL */
};
char *
urj_cmd_find_next (const char *text, int state)
{
static size_t cmd_idx, len;
if (!state)
{
cmd_idx = 0;
len = strlen (text);
}
while (urj_cmds[cmd_idx])
{
char *name = urj_cmds[cmd_idx++]->name;
if (!strncmp (name, text, len))
return strdup (name);
}
return NULL;
}
int
urj_cmd_test_cable (urj_chain_t *chain)
{

@ -32,6 +32,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_debug_run (urj_chain_t *chain, char *params[])
{
@ -55,7 +57,7 @@ cmd_debug_help (void)
"\n" "n =1 fileio, 2=tap commands, 4 =?\n"), "debug n");
}
urj_cmd_t urj_cmd_debug = {
const urj_cmd_t urj_cmd_debug = {
"debug",
N_("debug jtag program"),
cmd_debug_help,

@ -35,6 +35,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_detect_run (urj_chain_t *chain, char *params[])
{
@ -90,7 +92,7 @@ cmd_detect_help (void)
"detect");
}
urj_cmd_t urj_cmd_detect = {
const urj_cmd_t urj_cmd_detect = {
"detect",
N_("detect parts on the JTAG chain"),
cmd_detect_help,

@ -30,6 +30,8 @@
#include <urjtag/flash.h>
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_detectflash_run (urj_chain_t *chain, char *params[])
{
@ -62,7 +64,7 @@ cmd_detectflash_help (void)
"detectflash");
}
urj_cmd_t urj_cmd_detectflash = {
const urj_cmd_t urj_cmd_detectflash = {
"detectflash",
N_("detect parameters of flash chips attached to a part"),
cmd_detectflash_help,

@ -30,6 +30,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_discovery_run (urj_chain_t *chain, char *params[])
{
@ -60,7 +62,7 @@ cmd_discovery_help (void)
"discovery");
}
urj_cmd_t urj_cmd_discovery = {
const urj_cmd_t urj_cmd_discovery = {
"discovery",
N_("discovery of unknown parts in the JTAG chain"),
cmd_discovery_help,

@ -35,6 +35,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_dr_run (urj_chain_t *chain, char *params[])
{
@ -118,7 +120,7 @@ cmd_dr_help (void)
"dr", "dr");
}
urj_cmd_t urj_cmd_dr = {
const urj_cmd_t urj_cmd_dr = {
"dr",
N_("display active data register for a part"),
cmd_dr_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_endian_run (urj_chain_t *chain, char *params[])
{
@ -68,7 +70,7 @@ cmd_endian_help (void)
"endian [little|big]");
}
urj_cmd_t urj_cmd_endian = {
const urj_cmd_t urj_cmd_endian = {
"endian",
N_("set/print endianess"),
cmd_endian_help,

@ -33,6 +33,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_eraseflash_run (urj_chain_t *chain, char *params[])
{
@ -76,7 +78,7 @@ cmd_eraseflash_help (void)
_(urj_flash_flash_drivers[i]->description));
}
urj_cmd_t urj_cmd_eraseflash = {
const urj_cmd_t urj_cmd_eraseflash = {
"eraseflash",
N_("erase flash memory by number of blocks"),
cmd_eraseflash_help,

@ -33,6 +33,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_flashmem_run (urj_chain_t *chain, char *params[])
{
@ -99,7 +101,7 @@ cmd_flashmem_help (void)
_(urj_flash_flash_drivers[i]->description));
}
urj_cmd_t urj_cmd_flashmem = {
const urj_cmd_t urj_cmd_flashmem = {
"flashmem",
N_("burn flash memory with data from a file"),
cmd_flashmem_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_frequency_run (urj_chain_t *chain, char *params[])
{
@ -73,7 +75,7 @@ cmd_frequency_help (void)
"Use 0 for FREQ to disable frequency limit.\n"), "frequency");
}
urj_cmd_t urj_cmd_frequency = {
const urj_cmd_t urj_cmd_frequency = {
"frequency",
N_("setup JTAG frequency"),
cmd_frequency_help,

@ -33,6 +33,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_get_run (urj_chain_t *chain, char *params[])
{
@ -76,7 +78,7 @@ cmd_get_help (void)
"get signal");
}
urj_cmd_t urj_cmd_get = {
const urj_cmd_t urj_cmd_get = {
"get",
N_("get external signal value"),
cmd_get_help,

@ -29,6 +29,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_help_run (urj_chain_t *chain, char *params[])
{
@ -72,7 +74,7 @@ cmd_help_help (void)
"help");
}
urj_cmd_t urj_cmd_help = {
const urj_cmd_t urj_cmd_help = {
"help",
N_("display this help"),
cmd_help_help,

@ -29,6 +29,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_idcode_run (urj_chain_t *chain, char *params[])
{
@ -63,7 +65,7 @@ cmd_idcode_help (void)
"idcode");
}
urj_cmd_t urj_cmd_idcode = {
const urj_cmd_t urj_cmd_idcode = {
"idcode",
N_("Read IDCODEs of all parts in a JTAG chain"),
cmd_idcode_help,

@ -35,6 +35,8 @@
#include <urjtag/cmd.h>
#include <urjtag/bsdl.h>
#include "cmd.h"
static int
cmd_include_or_script_run (urj_chain_t *chain, int is_include, char *params[])
{
@ -133,7 +135,7 @@ cmd_include_help (void)
cmd_include_or_script_help ("include");
}
urj_cmd_t urj_cmd_include = {
const urj_cmd_t urj_cmd_include = {
"include",
N_("include command sequence from external repository"),
cmd_include_help,
@ -152,7 +154,7 @@ cmd_script_help (void)
cmd_include_or_script_help ("script");
}
urj_cmd_t urj_cmd_script = {
const urj_cmd_t urj_cmd_script = {
"script",
N_("run command sequence from external file"),
cmd_script_help,

@ -33,6 +33,8 @@
#include <urjtag/bus.h>
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_initbus_run (urj_chain_t *chain, char *params[])
{
@ -95,7 +97,7 @@ cmd_initbus_help (void)
urj_bus_drivers[i]->description);
}
const urj_cmd_t urj_cmd_initbus = {
const const urj_cmd_t urj_cmd_initbus = {
"initbus",
N_("initialize bus driver for active part"),
cmd_initbus_help,

@ -32,6 +32,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_instruction_run (urj_chain_t *chain, char *params[])
{
@ -97,7 +99,7 @@ cmd_instruction_help (void)
"instruction", "instruction", "instruction");
}
urj_cmd_t urj_cmd_instruction = {
const urj_cmd_t urj_cmd_instruction = {
"instruction",
N_("change active instruction for a part or declare new instruction"),
cmd_instruction_help,

@ -33,6 +33,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_part_run (urj_chain_t *chain, char *params[])
{
@ -115,7 +117,7 @@ cmd_part_help (void)
"\n" "bus->part part number | alias\n"), "part");
}
urj_cmd_t urj_cmd_part = {
const urj_cmd_t urj_cmd_part = {
"part",
N_("change active part for current JTAG chain"),
cmd_part_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_peek_run (urj_chain_t *chain, char *params[])
{
@ -88,7 +90,7 @@ cmd_peek_help (void)
"\n"), "peek");
}
urj_cmd_t urj_cmd_peek = {
const urj_cmd_t urj_cmd_peek = {
"peek",
N_("read a single word"),
cmd_peek_help,
@ -141,7 +143,7 @@ cmd_poke_help (void)
"\n"), "poke");
}
urj_cmd_t urj_cmd_poke = {
const urj_cmd_t urj_cmd_poke = {
"poke",
N_("write a single word"),
cmd_poke_help,

@ -35,6 +35,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_pod_run (urj_chain_t *chain, char *params[])
{
@ -87,7 +89,7 @@ cmd_pod_help (void)
"# 0 or 1\n"), "pod");
}
urj_cmd_t urj_cmd_pod = {
const urj_cmd_t urj_cmd_pod = {
"pod",
N_("Set state of POD signal(s)"),
cmd_pod_help,

@ -49,6 +49,8 @@ typedef char wchar_t;
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_print_run (urj_chain_t *chain, char *params[])
{
@ -258,7 +260,7 @@ cmd_print_help (void)
"print");
}
urj_cmd_t urj_cmd_print = {
const urj_cmd_t urj_cmd_print = {
"print",
N_("display JTAG chain list/status"),
cmd_print_help,

@ -28,6 +28,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_quit_run (urj_chain_t *chain, char *params[])
{
@ -43,7 +45,7 @@ cmd_quit_help (void)
printf (_("Usage: %s\n" "Exit from %s.\n"), "quit", PACKAGE);
}
urj_cmd_t urj_cmd_quit = {
const urj_cmd_t urj_cmd_quit = {
"quit",
N_("exit and terminate this session"),
cmd_quit_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_readmem_run (urj_chain_t *chain, char *params[])
{
@ -77,7 +79,7 @@ cmd_readmem_help (void)
"readmem");
}
urj_cmd_t urj_cmd_readmem = {
const urj_cmd_t urj_cmd_readmem = {
"readmem",
N_("read content of the memory and write it to file"),
cmd_readmem_help,

@ -35,6 +35,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_register_run (urj_chain_t *chain, char *params[])
{
@ -105,7 +107,7 @@ cmd_register_help (void)
"LENGTH Data register length\n"), "register");
}
urj_cmd_t urj_cmd_register = {
const urj_cmd_t urj_cmd_register = {
"register",
N_("define new data register for a part"),
cmd_register_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_reset_run (urj_chain_t *chain, char *params[])
{
@ -51,7 +53,7 @@ cmd_reset_help (void)
printf (_("Usage: %s\n" "Reset current JTAG chain.\n"), "reset");
}
urj_cmd_t urj_cmd_reset = {
const urj_cmd_t urj_cmd_reset = {
"reset",
N_("reset JTAG chain"),
cmd_reset_help,

@ -34,6 +34,8 @@
#include "urjtag/cmd.h"
#include "cmd.h"
static int
cmd_salias_run (urj_chain_t *chain, char *params[])
{

@ -37,6 +37,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_scan_run (urj_chain_t *chain, char *params[])
{
@ -129,7 +131,7 @@ cmd_scan_help (void)
"Read BSR and show changes since last scan.\n"), "scan");
}
urj_cmd_t urj_cmd_scan = {
const urj_cmd_t urj_cmd_scan = {
"scan",
N_("read BSR and show changes since last scan"),
cmd_scan_help,

@ -33,6 +33,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_set_run (urj_chain_t *chain, char *params[])
{
@ -92,7 +94,7 @@ cmd_set_help (void)
" is 'out'\n"), "set signal");
}
urj_cmd_t urj_cmd_set = {
const urj_cmd_t urj_cmd_set = {
"set",
N_("set external signal value"),
cmd_set_help,

@ -33,6 +33,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_shell_run (urj_chain_t *chain, char *params[])
{
@ -83,7 +85,7 @@ cmd_shell_help (void)
"\n" "CMMD OS Shell Command\n"), "shell cmmd");
}
urj_cmd_t urj_cmd_shell = {
const urj_cmd_t urj_cmd_shell = {
"shell",
N_("shell cmmd"),
cmd_shell_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_shift_run (urj_chain_t *chain, char *params[])
{
@ -63,7 +65,7 @@ cmd_shift_help (void)
"shift ir", "shift dr");
}
urj_cmd_t urj_cmd_shift = {
const urj_cmd_t urj_cmd_shift = {
"shift",
N_("shift data/instruction registers through JTAG chain"),
cmd_shift_help,

@ -34,6 +34,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_signal_run (urj_chain_t *chain, char *params[])
{
@ -91,7 +93,7 @@ cmd_signal_help (void)
"PIN# List of pin # for a signal\n"), "signal");
}
urj_cmd_t urj_cmd_signal = {
const urj_cmd_t urj_cmd_signal = {
"signal",
N_("define new signal for a part"),
cmd_signal_help,

@ -33,6 +33,8 @@
#include <urjtag/svf.h>
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_svf_run (urj_chain_t *chain, char *params[])
{
@ -87,7 +89,7 @@ cmd_svf_help (void)
"\n" "FILE file containing SVF commands\n"), "svf");
}
urj_cmd_t urj_cmd_svf = {
const urj_cmd_t urj_cmd_svf = {
"svf",
N_("execute svf commands from file"),
cmd_svf_help,

@ -35,6 +35,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_test_run (urj_chain_t *chain, char *params[])
{
@ -91,7 +93,7 @@ cmd_test_help (void)
"get signal");
}
urj_cmd_t urj_cmd_test = {
const urj_cmd_t urj_cmd_test = {
"test",
N_("test external signal value"),
cmd_test_help,

@ -31,6 +31,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_usleep_run (urj_chain_t *chain, char *params[])
{
@ -54,7 +56,7 @@ cmd_usleep_help (void)
"Sleep some number of microseconds.\n"), "usleep");
}
urj_cmd_t urj_cmd_usleep = {
const urj_cmd_t urj_cmd_usleep = {
"usleep",
N_("Sleep some number of microseconds"),
cmd_usleep_help,

@ -29,6 +29,8 @@
#include <urjtag/cmd.h>
#include "cmd.h"
static int
cmd_writemem_run (urj_chain_t *chain, char *params[])
{
@ -76,7 +78,7 @@ cmd_writemem_help (void)
"writemem");
}
urj_cmd_t urj_cmd_writemem = {
const urj_cmd_t urj_cmd_writemem = {
"writemem",
N_("write content of file to the memory"),
cmd_writemem_help,

Loading…
Cancel
Save