More JTAG interface driver cleanup:

- Moves references to global jtag interface to default core implementation.
- Missed this reference in the earlier "pointless" patch.  Mea culpa.

Important: this has a side-effect.  Previously, the error return inside
the interface routine short-circuited the remainder of that function
when 'init' has not been called.  With this patch, the command queue
will be cleared in the case that 'init' has been called.  Since that
case indicates a buggy script, this does not seem to be a problem.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1995 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
zwelch 2009-06-02 06:49:53 +00:00
parent c10d4d9a00
commit 4a70eeffb0
1 changed files with 9 additions and 10 deletions

View File

@ -1568,16 +1568,7 @@ void jtag_add_callback(jtag_callback1_t callback, u8 *in)
int interface_jtag_execute_queue(void)
{
int retval;
if (jtag==NULL)
{
LOG_ERROR("No JTAG interface configured yet. Issue 'init' command in startup scripts before communicating with targets.");
return ERROR_FAIL;
}
retval = default_interface_jtag_execute_queue();
int retval = default_interface_jtag_execute_queue();
if (retval == ERROR_OK)
{
struct jtag_callback_entry *entry;
@ -1598,6 +1589,14 @@ int interface_jtag_execute_queue(void)
int default_interface_jtag_execute_queue(void)
{
if (NULL == jtag)
{
LOG_ERROR("No JTAG interface configured yet. "
"Issue 'init' command in startup scripts "
"before communicating with targets.");
return ERROR_FAIL;
}
return jtag->execute_queue();
}