- added patch for new flash functionality like:
flash verify_image and flash erase_address. - added patch for new parport_write_on_exit command. Even this patch will fix some memory leaks. (thanks too oyvind and Spen for these patches) git-svn-id: svn://svn.berlios.de/openocd/trunk@240 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
@@ -2051,6 +2051,7 @@ int ft2232_quit(void)
|
||||
#endif
|
||||
|
||||
free(ft2232_buffer);
|
||||
ft2232_buffer = NULL;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -2137,3 +2138,4 @@ int ft2232_handle_latency_command(struct command_context_s *cmd_ctx, char *cmd,
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1345,6 +1345,7 @@ int jtag_validate_chain()
|
||||
char *cbuf = buf_to_str(ir_test, total_ir_length, 16);
|
||||
ERROR("Error validating JTAG scan chain, IR mismatch, scan returned 0x%s", cbuf);
|
||||
free(cbuf);
|
||||
free(ir_test);
|
||||
return ERROR_JTAG_INIT_FAILED;
|
||||
}
|
||||
chain_pos += device->ir_length;
|
||||
@@ -1356,6 +1357,7 @@ int jtag_validate_chain()
|
||||
char *cbuf = buf_to_str(ir_test, total_ir_length, 16);
|
||||
ERROR("Error validating JTAG scan chain, IR mismatch, scan returned 0x%s", cbuf);
|
||||
free(cbuf);
|
||||
free(ir_test);
|
||||
return ERROR_JTAG_INIT_FAILED;
|
||||
}
|
||||
|
||||
|
||||
+33
-5
@@ -120,8 +120,9 @@ cable_t cables[] =
|
||||
};
|
||||
|
||||
/* configuration */
|
||||
char* parport_cable;
|
||||
char* parport_cable = NULL;
|
||||
unsigned long parport_port;
|
||||
static int parport_exit = 0;
|
||||
|
||||
/* interface variables
|
||||
*/
|
||||
@@ -150,6 +151,7 @@ int parport_quit(void);
|
||||
/* interface commands */
|
||||
int parport_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
int parport_handle_parport_cable_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
int parport_handle_write_on_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
|
||||
|
||||
jtag_interface_t parport_interface =
|
||||
{
|
||||
@@ -249,7 +251,6 @@ void parport_reset(int trst, int srst)
|
||||
/* turn LED on parport adapter on (1) or off (0) */
|
||||
void parport_led(int on)
|
||||
{
|
||||
u8 output;
|
||||
if (on)
|
||||
dataport_value |= cable->LED_MASK;
|
||||
else
|
||||
@@ -271,6 +272,8 @@ int parport_register_commands(struct command_context_s *cmd_ctx)
|
||||
COMMAND_CONFIG, NULL);
|
||||
register_command(cmd_ctx, NULL, "parport_cable", parport_handle_parport_cable_command,
|
||||
COMMAND_CONFIG, NULL);
|
||||
register_command(cmd_ctx, NULL, "parport_write_on_exit", parport_handle_write_on_exit_command,
|
||||
COMMAND_CONFIG, NULL);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -429,11 +432,20 @@ int parport_init(void)
|
||||
|
||||
int parport_quit(void)
|
||||
{
|
||||
u8 output;
|
||||
parport_led(0);
|
||||
|
||||
dataport_value = cable->PORT_EXIT;
|
||||
parport_write_data();
|
||||
if (parport_exit)
|
||||
{
|
||||
dataport_value = cable->PORT_EXIT;
|
||||
parport_write_data();
|
||||
}
|
||||
|
||||
if (parport_cable)
|
||||
{
|
||||
free(parport_cable);
|
||||
parport_cable = NULL;
|
||||
}
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
@@ -463,3 +475,19 @@ int parport_handle_parport_cable_command(struct command_context_s *cmd_ctx, char
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
int parport_handle_write_on_exit_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
if (argc != 1)
|
||||
{
|
||||
command_print(cmd_ctx, "usage: parport_write_on_exit <on|off>");
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
if (strcmp(args[0], "on") == 0)
|
||||
parport_exit = 1;
|
||||
else if (strcmp(args[0], "off") == 0)
|
||||
parport_exit = 0;
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user