summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
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;