summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:47:36 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:47:36 -0500
commit339904d9514793ef435b9ab487c283b07675463e (patch)
treed33911efe209e7d4137e7b2d1c19184ee4c9f971
parentf2b6b52099e6b29d9ca659357c3aa0d0fd116b82 (diff)
take into account PW range shifting in voltage-control units
-rw-r--r--device-functions.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c
index f91a73a..d770093 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -2464,6 +2464,15 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
++curr_pw_range;
parse_sr = parse_sr >> 1;
}
+
+ if (globals.Flash.volt_ctrl_pw[channel]) {
+ // ranges are shifted in these units
+ ++curr_pw_range;
+ // except for minimum range
+ if (globals.Registers.shift_reg_out[3] & (long)0x01000) {
+ curr_pw_range = 0;
+ }
+ }
starting_range = curr_pw_range;
if (starting_range > globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]) {
@@ -2757,6 +2766,7 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int
}
}
+if (parameter==pwl_ampl_values) {printf ("selected %d\n",*relay_range);}
if (*word_out<0) {
*word_out=0;
return HardwareError;