From 12b2987a29aeb1714c1f61126e93806db5b7fd08 Mon Sep 17 00:00:00 2001 From: Marcel Telka Date: Tue, 22 Oct 2002 14:06:31 +0000 Subject: [PATCH] Added return for for tap_init(). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@197 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/include/ctrl.h | 2 +- jtag/src/jtag.c | 5 ++++- jtag/src/tap/ctrl.c | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/jtag/include/ctrl.h b/jtag/include/ctrl.h index 93e5c10b..4ad9585a 100644 --- a/jtag/include/ctrl.h +++ b/jtag/include/ctrl.h @@ -28,7 +28,7 @@ /* * low level tap functions, hardware dependent */ -void tap_init( void ); +int tap_init( void ); void tap_done( void ); void tap_clock( int tms, int tdi ); diff --git a/jtag/src/jtag.c b/jtag/src/jtag.c index 7b6bd879..ad5c1f84 100644 --- a/jtag/src/jtag.c +++ b/jtag/src/jtag.c @@ -57,7 +57,10 @@ main( void ) "There is absolutely no warranty for " PACKAGE ".\n\n" ); - tap_init(); + if (!tap_init()) { + printf( "TAP initialization failed! Exiting.\n" ); + return 1; + } tap_set_trst( 0 ); tap_set_trst( 1 ); diff --git a/jtag/src/tap/ctrl.c b/jtag/src/tap/ctrl.c index 5a11b800..773d759c 100644 --- a/jtag/src/tap/ctrl.c +++ b/jtag/src/tap/ctrl.c @@ -36,16 +36,18 @@ static unsigned short int port = 0x378; -void +int tap_init( void ) { tap_state_init(); printf( "Initilizing parallel TAP on port 0x%x\n", port ); if (ioperm( port, 2, 1 )) { printf( "Error: Initialization failed!\n" ); - return; + return 0; } tap_state_set_trst( (inb( port ) >> TRST) & 1 ); + + return 1; } void