From d879faa3cb8200c1c31e1a52c42e9bbacb9fac40 Mon Sep 17 00:00:00 2001 From: oharboe Date: Sun, 30 Aug 2009 17:30:14 +0000 Subject: David Brownell start phasing out integers as target IDs git-svn-id: svn://svn.berlios.de/openocd/trunk@2650 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- doc/openocd.texi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/openocd.texi b/doc/openocd.texi index 14dec6d2..8b679705 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -2365,6 +2365,10 @@ are examples; and there are many more. Several commands let you examine the list of targets: @deffn Command {target count} +@emph{Note: target numbers are deprecated; don't use them. +They will be removed shortly after August 2010, including this command. +Iterate target using @command{target names}, not by counting.} + Returns the number of targets, @math{N}. The highest numbered target is @math{N - 1}. @example @@ -2390,6 +2394,9 @@ foreach t [target names] @{ @end deffn @deffn Command {target number} number +@emph{Note: target numbers are deprecated; don't use them. +They will be removed shortly after August 2010, including this command.} + The list of targets is numbered starting at zero. This command returns the name of the target at index @var{number}. @example @@ -2711,8 +2718,7 @@ For example, if you wanted to summarize information about all the targets you might use something like this: @example -for @{ set x 0 @} @{ $x < [target count] @} @{ incr x @} @{ - set name [target number $x] +foreach name [target names] @{ set y [$name cget -endian] set z [$name cget -type] puts [format "Chip %d is %s, Endian: %s, type: %s" \ -- cgit v1.2.3