X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fjtag%2Fstartup.tcl;h=d57cafb23aa18bde0c84f1830d156903acb79e50;hb=7851207cf0d03428904a80f64db295268919ce86;hp=6f9c000d84a4164d2b433b2b4df80db11225577e;hpb=335bafbb2561d92d1631050e6aa3c4ab93e3644e;p=openocd.git diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 6f9c000d84..d57cafb23a 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -81,16 +81,16 @@ proc srst_asserted {} { # measure actual JTAG clock proc measure_clk {} { set start_time [ms]; - runtest 10000000; - echo "Running at more than [expr 10000.0 / ([ms]-$start_time)] kHz"; + set iterations 10000000; + runtest $iterations; + echo "Running at more than [expr $iterations.0 / ([ms]-$start_time)] kHz"; } add_help_text measure_clk "Runs a test to measure the JTAG clk. Useful with RCLK / RTCK." proc default_to_jtag { f args } { - if [catch {transport select} current_transport] { - echo "Info : session transport was not selected, defaulting to JTAG" - transport select jtag + set current_transport [transport select] + if {[using_jtag]} { eval $f $args } { error "session transport is \"$current_transport\" but your config requires JTAG"