From dc99289acd9644a365bbe662deaac2fef1b3035f Mon Sep 17 00:00:00 2001 From: root Date: Fri, 31 Dec 1999 19:00:31 -0500 Subject: when using attenuators, do not go to very top of raw ampl range --- device-functions.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'device-functions.c') diff --git a/device-functions.c b/device-functions.c index 464079c..203af45 100644 --- a/device-functions.c +++ b/device-functions.c @@ -2715,6 +2715,18 @@ int Set_VI_Control(int parameter,int channel,float new_ampl,int *point_found,int } else { use_atten = globals.Flash.attenuators[channel][*atten_range]; } + + // Limit max voltage in attenuator mode to 93% of full maximum, + // to avoid the region in AVPs where PW shifts at high amplitudes + float max1 = fabs(globals.Flash.min_ampl[channel]); + float max2 = fabs(globals.Flash.max_ampl[channel]); + if (max2 > max1) { + max1 = max2; + } + if ((use_ampl * use_atten) > + (globals.Flash.atten_percent_max_ampl[channel] * max1)) { + continue; + } } for (range_i=starting_range; (range_i