formatting.

git-svn-id: svn://svn.berlios.de/openocd/trunk@345 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
oharboe 2008-02-25 15:12:00 +00:00
parent a08d86e88d
commit 375c5f85d2
1 changed files with 1841 additions and 1841 deletions

View File

@ -1352,45 +1352,45 @@ int jtag_interface_init(struct command_context_s *cmd_ctx)
int jtag_init(struct command_context_s *cmd_ctx)
{
int i, validate_tries = 0;
jtag_device_t *device;
jtag_device_t *device;
DEBUG("-");
if (!jtag && jtag_interface_init(cmd_ctx) != ERROR_OK)
return ERROR_JTAG_INIT_FAILED;
return ERROR_JTAG_INIT_FAILED;
device = jtag_devices;
jtag_ir_scan_size = 0;
jtag_num_devices = 0;
while (device != NULL)
{
jtag_ir_scan_size += device->ir_length;
jtag_num_devices++;
device = device->next;
}
jtag_ir_scan_size = 0;
jtag_num_devices = 0;
while (device != NULL)
{
jtag_ir_scan_size += device->ir_length;
jtag_num_devices++;
device = device->next;
}
jtag_add_statemove(TAP_TLR);
jtag_execute_queue();
jtag_add_statemove(TAP_TLR);
jtag_execute_queue();
/* examine chain first, as this could discover the real chain layout */
if (jtag_examine_chain() != ERROR_OK)
{
ERROR("trying to validate configured JTAG chain anyway...");
}
/* examine chain first, as this could discover the real chain layout */
if (jtag_examine_chain() != ERROR_OK)
{
ERROR("trying to validate configured JTAG chain anyway...");
}
while (jtag_validate_chain() != ERROR_OK)
{
validate_tries++;
if (validate_tries > 5)
{
ERROR("Could not validate JTAG chain, exit");
jtag = NULL;
return ERROR_JTAG_INVALID_INTERFACE;
}
usleep(10000);
}
while (jtag_validate_chain() != ERROR_OK)
{
validate_tries++;
if (validate_tries > 5)
{
ERROR("Could not validate JTAG chain, exit");
jtag = NULL;
return ERROR_JTAG_INVALID_INTERFACE;
}
usleep(10000);
}
return ERROR_OK;
return ERROR_OK;
}
int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
@ -1406,21 +1406,21 @@ int handle_interface_command(struct command_context_s *cmd_ctx, char *cmd, char
/* interface name is a mandatory argument */
if (argc < 1 || args[0][0] == '\0')
{
{
return ERROR_COMMAND_SYNTAX_ERROR;
}
for (i=0; jtag_interfaces[i]; i++)
{
if (strcmp(args[0], jtag_interfaces[i]->name) == 0)
{
if (jtag_interfaces[i]->register_commands(cmd_ctx) != ERROR_OK)
exit(-1);
for (i=0; jtag_interfaces[i]; i++)
{
if (strcmp(args[0], jtag_interfaces[i]->name) == 0)
{
if (jtag_interfaces[i]->register_commands(cmd_ctx) != ERROR_OK)
exit(-1);
jtag_interface = jtag_interfaces[i];
return ERROR_OK;
}
}
return ERROR_OK;
}
}
/* no valid interface was found (i.e. the configuration option,
* didn't match one of the compiled-in interfaces