From 970d946c5793243678f97d0a88820df2bab6aed4 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Tue, 23 Jul 2002 22:22:58 +0000 Subject: [PATCH] Added current state checking into tap_shift_register(), tap_capture_dr() and tap_capture_ir() functions. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@76 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/tap/tap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jtag/src/tap/tap.c b/jtag/src/tap/tap.c index ce2f520d..81b93f38 100644 --- a/jtag/src/tap/tap.c +++ b/jtag/src/tap/tap.c @@ -46,6 +46,9 @@ tap_shift_register( const tap_register *in, tap_register *out, int exit ) { int i; + if (!(tap_state() & TAPSTAT_SHIFT)) + printf( "tap_shift_register: Invalid state: %2X\n", tap_state() ); + /* Capture-DR, Capture-IR, Shift-DR, Shift-IR, Exit2-DR or Exit2-IR state */ if (tap_state() & TAPSTAT_CAPTURE) tap_clock( 0, 0 ); /* save last TDO bit :-) */ @@ -62,6 +65,9 @@ tap_shift_register( const tap_register *in, tap_register *out, int exit ) void tap_capture_dr( void ) { + if ((tap_state() & (TAPSTAT_RESET | TAPSTAT_IDLE)) != TAPSTAT_IDLE) + printf( "tap_capture_dr: Invalid state: %2X\n", tap_state() ); + /* Run-Test/Idle or Update-DR or Update-IR state */ tap_clock( 1, 0 ); /* Select-DR-Scan */ tap_clock( 0, 0 ); /* Capture-DR */ @@ -70,6 +76,9 @@ tap_capture_dr( void ) void tap_capture_ir( void ) { + if ((tap_state() & (TAPSTAT_RESET | TAPSTAT_IDLE)) != TAPSTAT_IDLE) + printf( "tap_capture_ir: Invalid state: %2X\n", tap_state() ); + /* Run-Test/Idle or Update-DR or Update-IR state */ tap_clock( 1, 0 ); /* Select-DR-Scan */ tap_clock( 1, 0 ); /* Select-IR-Scan */