From: oharboe at B. <oh...@ma...> - 2009-06-04 09:05:28
|
Author: oharboe Date: 2009-06-04 09:05:22 +0200 (Thu, 04 Jun 2009) New Revision: 2041 Modified: trunk/src/jtag/jtag.c trunk/src/jtag/jtag.h Log: jtag_add_end_state() now returns the value of the global variable and does not modify the global variable if passed TAP_INVALID. This patch has no effect on the current code and is just to prepare upcoming patches. Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-06-04 06:56:22 UTC (rev 2040) +++ trunk/src/jtag/jtag.c 2009-06-04 07:05:22 UTC (rev 2041) @@ -773,13 +773,16 @@ } } -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) Modified: trunk/src/jtag/jtag.h =================================================================== --- trunk/src/jtag/jtag.h 2009-06-04 06:56:22 UTC (rev 2040) +++ trunk/src/jtag/jtag.h 2009-06-04 07:05:22 UTC (rev 2041) @@ -488,7 +488,16 @@ */ 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); |