Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
}
- struct command_context *context = Jim_GetAssocData(interp, "context");
+ struct command_context *context = current_command_context(interp);
int e = jtag_init_inner(context);
if (e != ERROR_OK) {
Jim_SetResult_sprintf(goi.interp, "error: %d", e);
Jim_WrongNumArgs(goi.interp, 1, goi.argv-1, "(no params)");
return JIM_ERR;
}
- struct command_context *context = Jim_GetAssocData(interp, "context");
+ struct command_context *context = current_command_context(interp);
int e = jtag_init_reset(context);
if (e != ERROR_OK) {
Jim_SetResult_sprintf(goi.interp, "error: %d", e);
// do nothing, just return the value
} else if (strcasecmp(cmd_name, "tapenable") == 0) {
if (!jtag_tap_enable(t))
- LOG_WARNING("failed to disable tap");
+ LOG_WARNING("failed to enable tap %s", t->dotted_name);
} else if (strcasecmp(cmd_name, "tapdisable") == 0) {
if (!jtag_tap_disable(t))
- LOG_WARNING("failed to disable tap");
+ LOG_WARNING("failed to disable tap %s", t->dotted_name);
} else {
LOG_ERROR("command '%s' unknown", cmd_name);
return JIM_ERR;
retval = parse_u32(CMD_ARGV[i * 2 + 1], &value);
if (ERROR_OK != retval)
goto error_return;
- buf_set_u32((void *)fields[i].out_value, 0, field_size, value);
+void *v = (void *)fields[i].out_value;
+ buf_set_u32(v, 0, field_size, value);
fields[i].in_value = NULL;
}
return ERROR_OK;
}
+COMMAND_HANDLER(handle_jtag_flush_queue_sleep)
+{
+ if (CMD_ARGC != 1)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ int sleep_ms;
+ COMMAND_PARSE_NUMBER(int, CMD_ARGV[0], sleep_ms);
+
+ jtag_set_flush_queue_sleep(sleep_ms);
+
+ return ERROR_OK;
+}
+
+
+
static const struct command_registration jtag_command_handlers[] = {
+
+ {
+ .name = "jtag_flush_queue_sleep",
+ .handler = handle_jtag_flush_queue_sleep,
+ .mode = COMMAND_ANY,
+ .help = "For debug purposes(simulate long delays of interface) "
+ "to test performance or change in behavior. Default 0ms.",
+ .usage = "[sleep in ms]",
+ },
{
.name = "jtag_rclk",
.handler = handle_jtag_rclk_command,