diff options
author | Paul Fertser <fercerpav@gmail.com> | 2014-03-01 22:40:54 +0400 |
---|---|---|
committer | Andreas Fritiofson <andreas.fritiofson@gmail.com> | 2014-06-28 09:28:12 +0000 |
commit | f8a6a07149d88737f3d466e7ce620cc1f0874c6a (patch) | |
tree | 2bc5c93183ad11608659fd3546297b21fd165eaa /tcl/target/swj-dp.tcl | |
parent | 36772a7ed0c31a99c721d1ea9131a8ecc56a263d (diff) | |
download | riscv-openocd-f8a6a07149d88737f3d466e7ce620cc1f0874c6a.zip riscv-openocd-f8a6a07149d88737f3d466e7ce620cc1f0874c6a.tar.gz riscv-openocd-f8a6a07149d88737f3d466e7ce620cc1f0874c6a.tar.bz2 |
tcl: introduce using_(jtag|swd|hla) helpers and use them in reset handler
Barely tested with plain SWD transport.
Change-Id: I48b59136bf4294ffed737dba01f1b30ef83aa86b
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2003
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Diffstat (limited to 'tcl/target/swj-dp.tcl')
-rw-r--r-- | tcl/target/swj-dp.tcl | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tcl/target/swj-dp.tcl b/tcl/target/swj-dp.tcl index fa44583..bd348e6 100644 --- a/tcl/target/swj-dp.tcl +++ b/tcl/target/swj-dp.tcl @@ -18,13 +18,8 @@ # split out "chip" and "tag" so we can someday handle # them more uniformly irlen too...) -global using_jtag -set using_jtag 1 - proc swj_newdap {chip tag args} { - global using_jtag - set tran [transport select] - if [string equal $tran "jtag"] { eval jtag newtap $chip $tag $args; set using_jtag 1 } - if [string equal $tran "swd"] { eval swd newdap $chip $tag $args; set using_jtag 0 } - if [string equal $tran "cmsis-dap"] { eval cmsis-dap newdap $chip $tag $args; set using_jtag 0 } + if {[using_jtag]} { eval jtag newtap $chip $tag $args } + if {[using_swd]} { eval swd newdap $chip $tag $args } + if {[string equal [transport select] "cmsis-dap"]} { eval cmsis-dap newdap $chip $tag $args } } |