summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;