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 ++++++++++++ flash.c | 2 ++ globals.h | 4 ++++ 3 files changed, 18 insertions(+) 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_iattenuators[i][j] = 0.0; } + + mem->atten_percent_max_ampl[i] = 0.93; } mem->relay_delay_in_sec=0.5; diff --git a/globals.h b/globals.h index e703617..ca50fdf 100644 --- a/globals.h +++ b/globals.h @@ -707,6 +707,10 @@ typedef struct { // for 15 dB, use 5.62 // for 10 dB, use 3.16 + float atten_percent_max_ampl[max_channels]; // addr 10134 - normally 0.93 + // don't use higher ampls in AVPs, + // where PW shifts near max ampl + char spare_end; char flash_end; -- cgit