X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fjtag%2Famt_jtagaccel.c;h=c7524cc12c09d0254be33665961d95fbd0ffb3e9;hb=a9d5119825aef1cbca3d9f6931cedafbfc7bcaed;hp=4071c25c984f285ba67e6dce74f0000327267c85;hpb=cd7f89f6bcc954da3ffa5b9b9eca49c32e152e7d;p=openocd diff --git a/src/jtag/amt_jtagaccel.c b/src/jtag/amt_jtagaccel.c index 4071c25c..c7524cc1 100644 --- a/src/jtag/amt_jtagaccel.c +++ b/src/jtag/amt_jtagaccel.c @@ -500,6 +500,7 @@ static int amt_jtagaccel_init(void) amt_jtagaccel_speed(jtag_get_speed()); + enum reset_types jtag_reset_config = jtag_get_reset_config(); if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) aw_control_rst &= ~0x8; else @@ -525,14 +526,26 @@ static int amt_jtagaccel_quit(void) return ERROR_OK; } -static int amt_jtagaccel_handle_parport_port_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) +static int amt_jtagaccel_handle_parport_port_command( + struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { - if (argc == 0) - return ERROR_OK; + if (argc == 1) + { + /* only if the port wasn't overwritten by cmdline */ + if (amt_jtagaccel_port == 0) + { + int retval = parse_u16(args[0], &amt_jtagaccel_port); + if (ERROR_OK != retval) + return retval; + } + else + { + LOG_ERROR("The parport port was already configured!"); + return ERROR_FAIL; + } + } - /* only if the port wasn't overwritten by cmdline */ - if (amt_jtagaccel_port == 0) - amt_jtagaccel_port = strtoul(args[0], NULL, 0); + command_print(cmd_ctx, "parport port = %u", amt_jtagaccel_port); return ERROR_OK; }