aboutsummaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
authorGareth McMullin2012-06-30 16:47:23 +1200
committerGareth McMullin2012-06-30 16:47:23 +1200
commit53af978295ad1faa982a1af21219eea19d270cd9 (patch)
tree1c99db4c2fd5d35c90d02afe538688bb59409f99 /src/command.c
parent01d0390b54856c0940f0ae7cb47266681a412e3c (diff)
Allow user to specify JTAG IR lengths.
This allows the use of devices that shift out values other than 0x01 from IR.
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/command.c b/src/command.c
index 241f877..74551d3 100644
--- a/src/command.c
+++ b/src/command.c
@@ -38,7 +38,7 @@
static bool cmd_version(void);
static bool cmd_help(target *t);
-static bool cmd_jtag_scan(void);
+static bool cmd_jtag_scan(target *t, int argc, char **argv);
static bool cmd_swdp_scan(void);
static bool cmd_targets(target *t);
static bool cmd_morse(void);
@@ -128,11 +128,22 @@ bool cmd_help(target *t)
return true;
}
-bool cmd_jtag_scan(void)
+static bool cmd_jtag_scan(target *t, int argc, char **argv)
{
+ (void)t;
+ uint8_t *irlens = NULL;
+
gdb_outf("Target voltage: %s\n", platform_target_voltage());
- int devs = jtag_scan();
+ if (argc > 1) {
+ /* Accept a list of IR lengths on command line */
+ irlens = alloca(argc);
+ for (int i = 1; i < argc; i++)
+ irlens[i-1] = atoi(argv[i]);
+ irlens[argc-1] = 0;
+ }
+
+ int devs = jtag_scan(irlens);
if(devs < 0) {
gdb_out("JTAG device scan failed!\n");