Fix chopper frequency modification.

This commit is contained in:
Ferdi Franceschini
2014-09-03 13:21:22 +10:00
parent 9a7f4608b7
commit 2d2b76dcb5
2 changed files with 4 additions and 4 deletions

View File

@ -91,7 +91,7 @@ driver astrium_chopper = {
set rhs "[string trim [lindex ${lst} 1]]" set rhs "[string trim [lindex ${lst} 1]]"
sct "attr_${lhs}" "${rhs}" sct "attr_${lhs}" "${rhs}"
set base [pathname [sct]] set base [pathname [sct]]
switch [string toupper [string trim ${node}]] { switch [string toupper ${lhs}] {
"ASPEED" { "ASPEED" {
if [string is double "${rhs}"] { if [string is double "${rhs}"] {
set freq [expr "${rhs}" / 60.0] set freq [expr "${rhs}" / 60.0]
@ -100,7 +100,7 @@ driver astrium_chopper = {
} }
} }
} }
"RSPEED" "APHASE" "RPHASE" "MASTER" { "RSPEED" - "APHASE" - "RPHASE" - "MASTER" {
if { "[hval ${base}/${node}]" != "${rhs}" } { if { "[hval ${base}/${node}]" != "${rhs}" } {
hset ${base}/${node} "${rhs}" hset ${base}/${node} "${rhs}"
} }

View File

@ -174,7 +174,7 @@ proc ::scobj::astrium_chopper::readState {tc_root} {
set rhs "[string trim [lindex ${lst} 1]]" set rhs "[string trim [lindex ${lst} 1]]"
sct "attr_${lhs}" "${rhs}" sct "attr_${lhs}" "${rhs}"
set base [pathname [sct]] set base [pathname [sct]]
switch [string toupper [string trim ${node}]] { switch [string toupper ${lhs}] {
"ASPEED" { "ASPEED" {
if [string is double "${rhs}"] { if [string is double "${rhs}"] {
set freq [expr "${rhs}" / 60.0] set freq [expr "${rhs}" / 60.0]
@ -183,7 +183,7 @@ proc ::scobj::astrium_chopper::readState {tc_root} {
} }
} }
} }
"RSPEED" "APHASE" "RPHASE" "MASTER" { "RSPEED" - "APHASE" - "RPHASE" - "MASTER" {
if { "[hval ${base}/${node}]" != "${rhs}" } { if { "[hval ${base}/${node}]" != "${rhs}" } {
hset ${base}/${node} "${rhs}" hset ${base}/${node} "${rhs}"
} }