From 455e236b0775dd8567540b81bc25d6b6f1bd4970 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Sat, 21 Sep 2002 16:54:36 +0000 Subject: [PATCH] Added parts initialization after `detect'. Added commands `instruction' and `shift'. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@132 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/jtag.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index d483e9f8..4d2e6a99 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -80,9 +80,15 @@ main( void ) break; if (strcmp( t, "detect" ) == 0) { + t = get_token( NULL ); if (ps) parts_free( ps ); ps = detect_parts( "../data" ); + parts_set_instruction( ps, "SAMPLE/PRELOAD" ); + parts_shift_instructions( ps ); + parts_shift_data_registers( ps ); + parts_set_instruction( ps, "BYPASS" ); + parts_shift_instructions( ps ); continue; } @@ -96,6 +102,54 @@ main( void ) continue; } + if (strcmp( t, "instruction" ) == 0) { + int n; + + t = get_token( NULL ); + if (!t) { + printf( "instruction: syntax error\n" ); + continue; + } + + n = strtol( t, &t, 10 ); + if (t && *t) { + printf( "instruction: syntax error\n" ); + continue; + } + + if ((n < 0) || (n >= ps->len)) { + printf( "instruction: invalid part number\n" ); + continue; + } + + t = get_token( NULL ); + if (!t) { + printf( "Missing instruction name\n" ); + continue; + } + + part_set_instruction( ps->parts[n], t ); + + continue; + } + + if (strcmp( t, "shift" ) == 0) { + t = get_token( NULL ); + + if (t && (strcmp( t, "ir" ) == 0)) { + parts_shift_instructions( ps ); + continue; + } + + if (t && (strcmp( t, "dr" ) == 0)) { + parts_shift_data_registers( ps ); + continue; + } + + printf( "shift: syntax error\n" ); + continue; + } + if (strcmp( t, "set" ) == 0) { t = get_token( NULL ); if (!t) {