X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tcl%2Fbitsbytes.tcl;h=756c725df6d95bfd1a20eb4d879ee3840b5d29fe;hb=9cdbe61aab418bdf75bc443b16ce4cdf96732e3e;hp=5f9cae114745bf2d89f003160680f9edcebb95d5;hpb=f5657aa76e795e4ed5b13a9f5df943181a123e49;p=fw%2Fopenocd diff --git a/tcl/bitsbytes.tcl b/tcl/bitsbytes.tcl index 5f9cae114..756c725df 100644 --- a/tcl/bitsbytes.tcl +++ b/tcl/bitsbytes.tcl @@ -2,7 +2,7 @@ # Purpose - Create some $BIT variables # Create $K and $M variables # and some bit field extraction variables. -# Creat helper variables ... +# Create helper variables ... # BIT0.. BIT31 for { set x 0 } { $x < 32 } { set x [expr {$x + 1}]} { @@ -36,7 +36,7 @@ proc create_mask { MSB LSB } { # Result: 0x02340000 proc extract_bitfield { VALUE MSB LSB } { - return [expr [create_mask $MSB $LSB] & $VALUE] + return [expr {[create_mask $MSB $LSB] & $VALUE}] } @@ -47,7 +47,7 @@ proc extract_bitfield { VALUE MSB LSB } { # Result: 0x00000234 # proc normalize_bitfield { VALUE MSB LSB } { - return [expr [extract_bitfield $VALUE $MSB $LSB ] >> $LSB] + return [expr {[extract_bitfield $VALUE $MSB $LSB ] >> $LSB}] } proc show_normalize_bitfield { VALUE MSB LSB } {