Encapsulate the global "jtag" jtag_interface pointer:
- Add jtag_interface_quit, factored from exit_handler() in openocd.c. - Remove its extern declaration. - Add static keyword to its definition. git-svn-id: svn://svn.berlios.de/openocd/trunk@1952 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -227,7 +227,7 @@ jtag_interface_t *jtag_interfaces[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
jtag_interface_t *jtag = NULL;
|
||||
static jtag_interface_t *jtag = NULL;
|
||||
|
||||
/* configuration */
|
||||
static jtag_interface_t *jtag_interface = NULL;
|
||||
@@ -2407,6 +2407,20 @@ static int jtag_init_inner(struct command_context_s *cmd_ctx)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int jtag_interface_quit(void)
|
||||
{
|
||||
if (!jtag || !jtag->quit)
|
||||
return ERROR_OK;
|
||||
|
||||
// close the JTAG interface
|
||||
int result = jtag->quit();
|
||||
if (ERROR_OK != result)
|
||||
LOG_ERROR("failed: %d", result);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
int jtag_init_reset(struct command_context_s *cmd_ctx)
|
||||
{
|
||||
int retval;
|
||||
|
||||
Reference in New Issue
Block a user