jtag_add_end_state() now returns the value of the global variable and does not modify...
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 4 Jun 2009 07:05:22 +0000 (07:05 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Thu, 4 Jun 2009 07:05:22 +0000 (07:05 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@2041 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/jtag.c
src/jtag/jtag.h

index 0733789f1bc7b308100f656ae55166bb16a3d1a0..2c53f9f4fe5a8a4352f1898d18575d4284eee24d 100644 (file)
@@ -773,13 +773,16 @@ void jtag_add_reset(int req_tlr_or_trst, int req_srst)
        }
 }
 
-void jtag_add_end_state(tap_state_t state)
+tap_state_t jtag_add_end_state(tap_state_t state)
 {
-       cmd_queue_end_state = state;
-       if ((cmd_queue_end_state == TAP_DRSHIFT)||(cmd_queue_end_state == TAP_IRSHIFT))
+       if ((state == TAP_DRSHIFT)||(state == TAP_IRSHIFT))
        {
                LOG_ERROR("BUG: TAP_DRSHIFT/IRSHIFT can't be end state. Calling code should use a larger scan field");
        }
+
+       if (state!=TAP_INVALID)
+               cmd_queue_end_state = state;
+       return cmd_queue_end_state;
 }
 
 void jtag_add_sleep(u32 us)
index 5fbe7dc103515dc2a2bf4b1724ef893fa55f3fd2..0d7d15e9a5e95f8dde3aecf8bfaa8d5422e30f3e 100644 (file)
@@ -488,7 +488,16 @@ extern void jtag_add_runtest(int num_cycles, tap_state_t endstate);
  */
 extern void jtag_add_reset(int req_tlr_or_trst, int srst);
 
-extern void jtag_add_end_state(tap_state_t endstate);
+
+/**
+ * Function jtag_add_stable_clocks
+ *
+ * Set a global variable to \a state if \a state != TAP_INVALID.
+ *
+ * Return the value of the global variable.
+ *
+ **/
+extern tap_state_t jtag_add_end_state(tap_state_t state);
 extern void jtag_add_sleep(u32 us);