2003-08-11 Marcel Telka <marcel@telka.sk>
* configure.ac (AC_INIT): Changed version number to 0.5. * include/chain.h (chain_t): Added active_part. * src/tap/chain.c (chain_alloc): Added active_part initialization. * include/part.h (parts_print): Removed 'header' parameter. * src/part/part.c (parts_print): Removed header printing. * src/cmd/print.c (cmd_print_run): Added header printg. Added new parameter 'chain' for print command. (cmd_print_help): Added new parameter 'chain'. * src/cmd/dr.c (cmd_dr_run, cmd_dr_help): Removed PART parameter. * src/cmd/get.c (cmd_get_run, cmd_get_help): Ditto. * src/cmd/instruction.c (cmd_instruction_run, cmd_instruction_help): Ditto. * src/cmd/set.c (cmd_set_run, cmd_set_help): Ditto. * src/cmd/Makefile.am (libcmd_a_SOURCES): Adde part.c. * src/cmd/part.c: New file. * src/cmd/cmd.c (cmds): Added cmd_part. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@495 b68d4a1b-bc3d-0410-92ed-d4ac073336b7master
parent
35660b487e
commit
d20cf94c4e
@ -0,0 +1,79 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2003 ETC s.r.o.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
* 02111-1307, USA.
|
||||
*
|
||||
* Written by Marcel Telka <marcel@telka.sk>, 2003.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "jtag.h"
|
||||
|
||||
#include "cmd.h"
|
||||
|
||||
static int
|
||||
cmd_part_run( char *params[] )
|
||||
{
|
||||
unsigned int n;
|
||||
|
||||
if (cmd_params( params ) != 2)
|
||||
return -1;
|
||||
|
||||
if (!cmd_test_cable())
|
||||
return 1;
|
||||
|
||||
if (!chain->parts) {
|
||||
printf( _("Run \"detect\" first.\n") );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (cmd_get_number( params[1], &n ))
|
||||
return -1;
|
||||
|
||||
if (n >= chain->parts->len) {
|
||||
printf( _("%s: invalid part number\n"), "part" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
chain->active_part = n;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd_part_help( void )
|
||||
{
|
||||
printf( _(
|
||||
"Usage: %s PART\n"
|
||||
"Change active part for current JTAG chain.\n"
|
||||
"\n"
|
||||
"PART part number\n"
|
||||
), "part" );
|
||||
}
|
||||
|
||||
cmd_t cmd_part = {
|
||||
"part",
|
||||
N_("change active part for current JTAG chain"),
|
||||
cmd_part_help,
|
||||
cmd_part_run
|
||||
};
|
Loading…
Reference in New Issue