summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-17 14:07:03 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-17 14:07:03 +0000
commit3160f4a48d2eb26e1edcde3af3b3f12aa3b9d025 (patch)
tree51d5e159f46bdfd8b3fc8bdee349daa96d0491f2
parentbb563397616a67320b7dbc786195ca52693b880b (diff)
downloadopenocd+libswd-3160f4a48d2eb26e1edcde3af3b3f12aa3b9d025.tar.gz
openocd+libswd-3160f4a48d2eb26e1edcde3af3b3f12aa3b9d025.tar.bz2
openocd+libswd-3160f4a48d2eb26e1edcde3af3b3f12aa3b9d025.tar.xz
openocd+libswd-3160f4a48d2eb26e1edcde3af3b3f12aa3b9d025.zip
more houskeeping
git-svn-id: svn://svn.berlios.de/openocd/trunk@1256 b42882b7-edfa-0310-969c-e2dbd0fdcd60
-rw-r--r--src/jtag/zy1000.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/jtag/zy1000.c b/src/jtag/zy1000.c
index 86b98ca7..e74478a6 100644
--- a/src/jtag/zy1000.c
+++ b/src/jtag/zy1000.c
@@ -319,6 +319,25 @@ int handle_zy1000_version_command(struct command_context_s *cmd_ctx, char *cmd,
}
+static int
+zylinjtag_Jim_Command_powerstatus(Jim_Interp *interp,
+ int argc,
+ Jim_Obj * const *argv)
+{
+ if (argc != 1)
+ {
+ Jim_WrongNumArgs(interp, 1, argv, "powerstatus");
+ return JIM_ERR;
+ }
+
+ cyg_uint32 status;
+ ZY1000_PEEK(ZY1000_JTAG_BASE+0x10, status);
+
+ Jim_SetResult(interp, Jim_NewIntObj(interp, (status&0x80)!=0));
+
+ return JIM_OK;
+}
+
int zy1000_register_commands(struct command_context_s *cmd_ctx)
{
register_command(cmd_ctx, NULL, "power", handle_power_command, COMMAND_ANY,
@@ -326,11 +345,14 @@ int zy1000_register_commands(struct command_context_s *cmd_ctx)
register_command(cmd_ctx, NULL, "zy1000_version", handle_zy1000_version_command,
COMMAND_EXEC, "show zy1000 version numbers");
+ Jim_CreateCommand(interp, "powerstatus", zylinjtag_Jim_Command_powerstatus, NULL, NULL);
return ERROR_OK;
}
+
+
int zy1000_init(void)
{
LOG_ERROR("%s\n", ZYLIN_OPENOCD_VERSION);