flash_banks now follow OpenOCD scripting API rules

git-svn-id: svn://svn.berlios.de/openocd/trunk@814 b42882b7-edfa-0310-969c-e2dbd0fdcd60
__archive__
oharboe 2008-07-16 12:44:00 +00:00
parent f806c8deab
commit ffe9257a17
2 changed files with 6 additions and 1 deletions

View File

@ -164,10 +164,15 @@ static int Jim_Command_flash_banks(Jim_Interp *interp, int argc, Jim_Obj *const
Jim_Obj *elem=Jim_NewListObj(interp, NULL, 0); Jim_Obj *elem=Jim_NewListObj(interp, NULL, 0);
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "name", -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1)); Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, p->driver->name, -1));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "base", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->base)); Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->base));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "size", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->size)); Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->size));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "bus_width", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->bus_width)); Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->bus_width));
Jim_ListAppendElement(interp, elem, Jim_NewStringObj(interp, "chip_width", -1));
Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->chip_width)); Jim_ListAppendElement(interp, elem, Jim_NewIntObj(interp, p->chip_width));
Jim_ListAppendElement(interp, list, elem); Jim_ListAppendElement(interp, list, elem);

View File

@ -46,7 +46,7 @@ proc flash_banks_pretty {} {
if {$i > 0} { if {$i > 0} {
set result "$result\n" set result "$result\n"
} }
set result [format "$result#%d: %s at 0x%08x, size 0x%08x, buswidth %d, chipwidth %d" $i [lindex $a 0] [lindex $a 1] [lindex $a 2] [lindex $a 3] [lindex $a 4]] set result [format "$result#%d: %s at 0x%08x, size 0x%08x, buswidth %d, chipwidth %d" $i $a(name) $a(base) $a(size) $a(bus_width) $a(chip_width)]
set i [expr $i+1] set i [expr $i+1]
} }
return $result return $result