}
-void jtag_add_clocks( int num_cycles )
+void jtag_add_clocks(int num_cycles)
{
- int retval;
-
- if( !tap_is_state_stable(cmd_queue_cur_state) )
+ if (!tap_is_state_stable(cmd_queue_cur_state))
{
- LOG_ERROR( "jtag_add_clocks() was called with TAP in non-stable state \"%s\"",
- tap_state_name(cmd_queue_cur_state) );
- jtag_error = ERROR_JTAG_NOT_STABLE_STATE;
+ LOG_ERROR("jtag_add_clocks() called with TAP in unstable state \"%s\"",
+ tap_state_name(cmd_queue_cur_state));
+ jtag_set_error(ERROR_JTAG_NOT_STABLE_STATE);
return;
}
- if( num_cycles > 0 )
+ if (num_cycles > 0)
{
jtag_checks();
-
- retval = interface_jtag_add_clocks(num_cycles);
- if (retval != ERROR_OK)
- jtag_error=retval;
+ jtag_set_error(interface_jtag_add_clocks(num_cycles));
}
}
void jtag_add_reset(int req_tlr_or_trst, int req_srst)
{
int trst_with_tlr = 0;
- int retval;
/* FIX!!! there are *many* different cases here. A better
* approach is needed for legal combinations of transitions...
if (((jtag_reset_config & RESET_SRST_PULLS_TRST) && (req_srst == 1)) && (!req_tlr_or_trst))
{
LOG_ERROR("BUG: requested reset would assert trst");
- jtag_error=ERROR_FAIL;
+ jtag_set_error(ERROR_FAIL);
return;
}
if (req_srst && !(jtag_reset_config & RESET_HAS_SRST))
{
LOG_ERROR("BUG: requested SRST assertion, but the current configuration doesn't support this");
- jtag_error=ERROR_FAIL;
+ jtag_set_error(ERROR_FAIL);
return;
}
jtag_srst = req_srst;
- retval = interface_jtag_add_reset(jtag_trst, jtag_srst);
- if (retval!=ERROR_OK)
+ int retval = interface_jtag_add_reset(jtag_trst, jtag_srst);
+ if (retval != ERROR_OK)
{
- jtag_error=retval;
+ jtag_set_error(retval);
return;
}
jtag_execute_queue();