With this patch UrJTAG will indicate the active part in the chain when
print chain. Like this:

jtag> print chain
 No. Manufacturer              Part                 Stepping
Instruction          Register
-------------------------------------------------------------------------------------------------------------------
   0 Analog Devices, Inc.      BF561                5        BYPASS
           BR
*  1 Analog Devices, Inc.      BF561                5        BYPASS
           BR

"*" indicates that part 1 is the active part currently.

Committed.

Regards,
Jie
  * src/cmd/cmd_print.c (cmd_print_run): Pass active part to
    urj_part_parts_print.
  * src/part/part.c (urj_part_parts_print): Add a new argument
    for active part.
  * include/urjtag/part.h (urj_part_parts_print): Update declaration.

Index: src/cmd/cmd_print.c
===================================================================
--- src/cmd/cmd_print.c	(revision 5702)
+++ src/cmd/cmd_print.c	(working copy)
@@ -251,7 +251,7 @@ cmd_print_run (urj_chain_t *chain, char
 
     if (strcasecmp (params[1], "chain") == 0)
     {
-        urj_part_parts_print (URJ_LOG_LEVEL_NORMAL, chain->parts);
+        urj_part_parts_print (URJ_LOG_LEVEL_NORMAL, chain->parts, chain->active_part);
         return URJ_STATUS_OK;
     }
 
Index: src/part/part.c
===================================================================
--- src/part/part.c	(revision 5702)
+++ src/part/part.c	(working copy)
@@ -459,7 +459,7 @@ urj_part_parts_set_instruction (urj_part
 }
 
 int
-urj_part_parts_print (urj_log_level_t ll, urj_parts_t *ps)
+urj_part_parts_print (urj_log_level_t ll, urj_parts_t *ps, int active_part)
 {
     int i;
 
@@ -476,7 +476,7 @@ urj_part_parts_print (urj_log_level_t ll
         if (!p)
             continue;
 
-        urj_log (ll, _(" %3d "), i);
+        urj_log (ll, "%s%3d ", i == active_part ? "*" : " ", i);
         urj_part_print (ll, p);
     }
 
Index: include/urjtag/part.h
===================================================================
--- include/urjtag/part.h	(revision 5702)
+++ include/urjtag/part.h	(working copy)
@@ -126,6 +126,6 @@ int urj_part_parts_add_part (urj_parts_t
 /* @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */
 int urj_part_parts_set_instruction (urj_parts_t *ps, const char *iname);
 /* @return URJ_STATUS_OK on success; URJ_STATUS_FAIL on error */
-int urj_part_parts_print (urj_log_level_t ll, urj_parts_t *ps);
+int urj_part_parts_print (urj_log_level_t ll, urj_parts_t *ps, int active_part);
 
 #endif /* URJ_PART_H */
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to