From 68e3cf5966b800cb323c2366e20c62ee5b92d7dd Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Sat, 16 Feb 2008 22:42:52 +0000 Subject: [PATCH] Always flush after each command during interactive use git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1037 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 2 ++ jtag/include/chain.h | 1 + jtag/src/jtag.c | 4 +++- jtag/src/tap/chain.c | 8 ++++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 12b26d18..4cbc48bd 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -8,6 +8,8 @@ 2008-02-16 Kolja Waschk + * src/jtag.c, src/tap/chain.c, include/chain.h: Always flush immediately + after each command when used interactively * src/cmd/scan.c, src/cmd/Makefile.am, src/cmd/cmd.c: Implemented basic boundary "scan" command to detect changes on input pins; tested with an (completely erased) Actel ProASIC3 A3P125 diff --git a/jtag/include/chain.h b/jtag/include/chain.h index a2ba82f4..400f9019 100644 --- a/jtag/include/chain.h +++ b/jtag/include/chain.h @@ -53,6 +53,7 @@ void chain_shift_instructions( chain_t *chain ); void chain_shift_instructions_mode( chain_t *chain, int capture, int exit ); void chain_shift_data_registers( chain_t *chain, int capture_output ); void chain_shift_data_registers_mode( chain_t *chain, int capture_output, int capture, int exit ); +void chain_flush( chain_t *chain ); typedef struct { chain_t **chains; diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index 44caa1fd..7a67986a 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -58,6 +58,7 @@ ssize_t getline( char **lineptr, size_t *n, FILE *stream ); chain_t *chain = NULL; int debug_mode = 0; int big_endian = 0; +int interactive = 0; extern cfi_array_t *cfi_array; static char * @@ -216,6 +217,8 @@ static int jtag_readline_multiple_commands_support(char * line) /* multiple comm } r = jtag_parse_line( line ); + + chain_flush( chain ); } while (nextcmd && r); @@ -336,7 +339,6 @@ main( int argc, char *const argv[] ) int i; int c; int norc = 0; - int interactive = 0; int help = 0; int version = 0; diff --git a/jtag/src/tap/chain.c b/jtag/src/tap/chain.c index 9152157b..1d266b79 100644 --- a/jtag/src/tap/chain.c +++ b/jtag/src/tap/chain.c @@ -200,3 +200,11 @@ chain_shift_data_registers( chain_t *chain, int capture_output ) { chain_shift_data_registers_mode( chain, capture_output, 1, EXITMODE_IDLE ); } + +void +chain_flush( chain_t *chain ) +{ + if( chain->cable != NULL) + cable_flush( chain->cable, COMPLETELY ); +} +