diff options
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c index de21933..46b9083 100644 --- a/device-functions.c +++ b/device-functions.c @@ -2456,6 +2456,22 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int top_range_only=1; } + if (globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]) { + int curr_pw_range = 0; + int parse_sr = globals.Registers.shift_reg_out[3] & 0x7f; + + while (parse_sr) { + ++curr_pw_range; + parse_sr = parse_sr >> 1; + } + + starting_range = curr_pw_range; + + if (starting_range > globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]) { + starting_range = globals.Flash.couple_first_N_pw_ranges_to_ampl_ranges[channel]; + } + } + break; case pwl_os_values: decreasing_values_allowed=YES; /* allows Vc=0 to corresponds to most + OS, and Vc=10V to give most - OS */ |