summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authorMike <mjc@avtechpulse.com>2000-01-01 00:29:40 +0900
committerMike <mjc@avtechpulse.com>2000-01-01 00:29:40 +0900
commit239127c53ec3cdab92611108407141ca6b39b33f (patch)
tree11270cfe0302f8df296905cc190e38894d86741d /device-functions.c
parent5e85e54a9dadaaa5bfb9e8495af56c8dc1363600 (diff)
fix ampl min/max checks when max_ampl is limited by max_vout (some -OT units)
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/device-functions.c b/device-functions.c
index b54e14b..c66357e 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -2077,7 +2077,8 @@ int Set_Cal_Nom(int channel,int calibration_point_number,int parameter, float *n
nominal_wordout_aux=0;
}
- if (Set_Amplitude(0,0,0,0,0,0,0,channel,globals.Flash.min_ampl[channel],0) || Set_Amplitude(0,0,0,0,0,0,0,channel,globals.Flash.max_ampl[channel],0)) {
+ if ( Set_Amplitude(0,0,0,0,0,0,0,channel,MAX(globals.Flash.min_ampl[channel],globals.Flash.min_vout[channel]),0) ||
+ Set_Amplitude(0,0,0,0,0,0,0,channel,MIN(globals.Flash.max_ampl[channel],globals.Flash.max_vout[channel]),0)) {
/* confirm that timing settings can support min/max ampl settings */
return CalibrationTimingProblem;
}
@@ -3566,8 +3567,8 @@ int Check_MinMax_Cal(int channel,int parameter)
/* see if new point prevents zero, min, max, or current value from being obtained */
switch (parameter) {
case (pwl_ampl_values):
- if (status=Set_Amplitude(1,0,0,0,0,0,0,channel,globals.Flash.min_ampl[channel],0)) return status;
- if (status=Set_Amplitude(1,0,0,0,0,0,0,channel,globals.Flash.max_ampl[channel],0)) return status;
+ if (status=Set_Amplitude(1,0,0,0,0,0,0,channel,MAX(globals.Flash.min_ampl[channel],globals.Flash.min_vout[channel]),0)) return status;
+ if (status=Set_Amplitude(1,0,0,0,0,0,0,channel,MIN(globals.Flash.max_ampl[channel],globals.Flash.max_vout[channel]),0)) return status;
if (status=Set_Amplitude(1,0,0,0,0,0,0,channel,rst_ampl_value(channel),0)) return status;
break;