diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index c1eb2b2ee..3060c5c06 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -81,9 +81,10 @@ proc srst_asserted {} { # measure actual JTAG clock proc measure_clk {} { set start_time [ms]; - set iterations 10000000; + set iterations 10000000; runtest $iterations; - echo "Running at more than [expr $iterations.0 / ([ms]-$start_time)] kHz"; + set speed [expr "$iterations.0 / ([ms] - $start_time)"] + echo "Running at more than $speed kHz"; } add_help_text measure_clk "Runs a test to measure the JTAG clk. Useful with RCLK / RTCK." diff --git a/src/target/startup.tcl b/src/target/startup.tcl index cee036697..54a3942c5 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -1,7 +1,7 @@ # Defines basic Tcl procs for OpenOCD target module proc new_target_name { } { - return [target number [expr [target count] - 1 ]] + return [target number [expr {[target count] - 1}]] } global in_process_reset @@ -16,7 +16,7 @@ proc ocd_process_reset { MODE } { } set in_process_reset 1 - set success [expr [catch {ocd_process_reset_inner $MODE} result]==0] + set success [expr {[catch {ocd_process_reset_inner $MODE} result] == 0}] set in_process_reset 0 if {$success} {