From: <oh...@ma...> - 2008-12-17 15:07:05
|
Author: oharboe Date: 2008-12-17 15:07:03 +0100 (Wed, 17 Dec 2008) New Revision: 1256 Modified: trunk/src/jtag/zy1000.c zy1000/trunk/build/menu/zy1000menu.xml zy1000/trunk/build/tcl/index.tcl Log: more houskeeping Modified: trunk/src/jtag/zy1000.c =================================================================== --- trunk/src/jtag/zy1000.c 2008-12-17 13:39:40 UTC (rev 1255) +++ trunk/src/jtag/zy1000.c 2008-12-17 14:07:03 UTC (rev 1256) @@ -319,6 +319,25 @@ } +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 @@ 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); Modified: zy1000/trunk/build/menu/zy1000menu.xml =================================================================== --- zy1000/trunk/build/menu/zy1000menu.xml 2008-12-17 13:39:40 UTC (rev 1255) +++ zy1000/trunk/build/menu/zy1000menu.xml 2008-12-17 14:07:03 UTC (rev 1256) @@ -85,7 +85,7 @@ <tr> <td class="fontbigger" style="height:20px;padding-right:10px;">Target power: <tcl> - if {[expr [peek 0x08000010] & 0x80]!=0} { + if {[powerstatus]!=0} { append buffer "no" } else { append buffer "yes" Modified: zy1000/trunk/build/tcl/index.tcl =================================================================== --- zy1000/trunk/build/tcl/index.tcl 2008-12-17 13:39:40 UTC (rev 1255) +++ zy1000/trunk/build/tcl/index.tcl 2008-12-17 14:07:03 UTC (rev 1256) @@ -187,7 +187,7 @@ <tr> <td class="fontbigger" style="height:20px;padding-right:10px;">Target power: <tcl> - if {[expr [peek 0x08000010] & 0x80]!=0} { + if {[powerstatus]!=0} { append buffer "no" } else { append buffer "yes" |