2004-08-15 Marcel Telka <marcel@telka.sk>

* include/jtag.h (detect_parts): Changed return type.
	* src/detect.c (detect_parts): Changed return value to return number of detected parts.
	* src/cmd/detect.c (cmd_detect_run): Added reset of the chain->parts to NULL before
		detect_parts() call. Ignored detect_parts() return value.


git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@604 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Marcel Telka 21 years ago
parent 4bd78f389e
commit fb1b33970e

@ -1,3 +1,10 @@
2004-08-15 Marcel Telka <marcel@telka.sk>
* include/jtag.h (detect_parts): Changed return type.
* src/detect.c (detect_parts): Changed return value to return number of detected parts.
* src/cmd/detect.c (cmd_detect_run): Added reset of the chain->parts to NULL before
detect_parts() call. Ignored detect_parts() return value.
2004-08-13 Marcel Telka <marcel@telka.sk>
* src/jtag.c: Added missing locale.h include (patch 986414, Martin Buck).

@ -40,7 +40,7 @@ extern int big_endian;
int jtag_parse_file( const char *filename );
parts_t *detect_parts( chain_t *chain, char *db_path );
int detect_parts( chain_t *chain, char *db_path );
int detect_register_size( chain_t *chain );
void discovery( chain_t *chain );

@ -44,7 +44,8 @@ cmd_detect_run( char *params[] )
buses_free();
parts_free( chain->parts );
chain->parts = detect_parts( chain, JTAG_DATA_DIR );
chain->parts = NULL;
detect_parts( chain, JTAG_DATA_DIR );
if (!chain->parts)
return 1;
if (!chain->parts->len) {

@ -160,7 +160,7 @@ find_record( char *filename, tap_register *key, struct id_record *idr )
return r;
}
parts_t *
int
detect_parts( chain_t *chain, char *db_path )
{
int irlen;
@ -184,7 +184,7 @@ detect_parts( chain_t *chain, char *db_path )
tap_capture_ir( chain );
irlen = detect_register_size( chain );
if (irlen < 1)
return NULL;
return 0;
printf( _("IR length: %d\n"), irlen );
@ -192,7 +192,7 @@ detect_parts( chain_t *chain, char *db_path )
ir = register_fill( register_alloc( irlen ), 1 );
if (ir == NULL) {
printf( _("out of memory\n") );
return NULL;
return 0;
}
tap_shift_register( chain, ir, NULL, 1 );
@ -203,7 +203,7 @@ detect_parts( chain_t *chain, char *db_path )
chlen = detect_register_size( chain );
if (chlen < 1) {
printf( _("Unable to detect JTAG chain length\n") );
return NULL;
return 0;
}
printf( _("Chain length: %d\n"), chlen );
@ -221,7 +221,7 @@ detect_parts( chain_t *chain, char *db_path )
register_free( br );
register_free( id );
parts_free( ps );
return NULL;
return 0;
}
chain->parts = ps;
chain->active_part = 0;
@ -361,5 +361,5 @@ detect_parts( chain_t *chain, char *db_path )
register_free( br );
register_free( id );
return ps;
return ps->len;
}

Loading…
Cancel
Save