From 84024cb5bdec1de570471d4195d0273388f049ae Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Tue, 5 Nov 2002 22:04:18 +0000 Subject: [PATCH] BUSY is always inverted at input. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@260 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/src/tap/ctrl.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jtag/src/tap/ctrl.c b/jtag/src/tap/ctrl.c index df3f73b9..3927c869 100644 --- a/jtag/src/tap/ctrl.c +++ b/jtag/src/tap/ctrl.c @@ -28,11 +28,21 @@ #include "ctrl.h" #include "state.h" +/* + * data D[7:0] (pins 9:2) + */ #define TCK 0 #define TDI 1 #define TMS 2 #define TRST 4 +/* + * 7 - BUSY (pin 11) + * 6 - ACK (pin 10) + * 5 - PE (pin 12) + * 4 - SEL (pin 13) + * 3 - ERROR (pin 15) + */ #define TDO 7 static unsigned short int port = 0x378; @@ -77,7 +87,7 @@ int tap_get_tdo( void ) { outb( (tap_state_get_trst() << TRST) | (0 << TCK), port ); - return ((inb( port + 1 ) >> TDO) & 1) ^ 1; + return ((inb( port + 1 ) ^ 0x80) >> TDO) & 1; /* BUSY is inverted */ } void