if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (argc == 1)
- jtag_set_nsrst_delay(strtoul(args[0], NULL, 0));
+ {
+ unsigned delay;
+ int retval = parse_uint(args[0], &delay);
+ if (ERROR_OK != retval)
+ return retval;
+ jtag_set_nsrst_delay(delay);
+ }
command_print(cmd_ctx, "jtag_nsrst_delay: %u", jtag_get_nsrst_delay());
return ERROR_OK;
}
if (argc > 1)
return ERROR_COMMAND_SYNTAX_ERROR;
if (argc == 1)
- jtag_set_ntrst_delay(strtoul(args[0], NULL, 0));
+ {
+ unsigned delay;
+ int retval = parse_uint(args[0], &delay);
+ if (ERROR_OK != retval)
+ return retval;
+ jtag_set_ntrst_delay(delay);
+ }
command_print(cmd_ctx, "jtag_ntrst_delay: %u", jtag_get_ntrst_delay());
return ERROR_OK;
}
{
LOG_DEBUG("handle jtag speed");
- int cur_speed = 0;
- cur_speed = strtoul(args[0], NULL, 0);
+ unsigned cur_speed = 0;
+ int retval = parse_uint(args[0], &cur_speed);
+ if (ERROR_OK != retval)
+ return retval;
retval = jtag_set_speed(cur_speed);
}
int retval = ERROR_OK;
if (argc == 1)
{
- retval = jtag_config_khz(strtoul(args[0], NULL, 0));
+ unsigned khz = 0;
+ int retval = parse_uint(args[0], &khz);
+ if (ERROR_OK != retval)
+ return retval;
+ retval = jtag_config_khz(khz);
if (ERROR_OK != retval)
return retval;
}