From cb7dbc1af41068f826246beb53870c01d8973bb8 Mon Sep 17 00:00:00 2001 From: Zachary T Welch Date: Tue, 17 Nov 2009 08:29:20 -0800 Subject: split startup.tcl file across modules Moves definitions for each layer into their own file, eliminating layering violations in the built-in TCL code. Updates src/Makefile.am rules to include all files in the final startup.tcl input file, and others Makefile.am rules to distribute the new files in our packages. --- src/flash/startup.tcl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/flash/startup.tcl (limited to 'src/flash/startup.tcl') diff --git a/src/flash/startup.tcl b/src/flash/startup.tcl new file mode 100644 index 00000000..fcebbe01 --- /dev/null +++ b/src/flash/startup.tcl @@ -0,0 +1,16 @@ +# Defines basic Tcl procs for OpenOCD flash module + +# Show flash in human readable form +# This is an example of a human readable form of a low level fn +proc flash_banks {} { + set i 0 + set result "" + foreach {a} [ocd_flash_banks] { + if {$i > 0} { + set result "$result\n" + } + 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] + } + return $result +} -- cgit v1.2.3