summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/device-functions.c b/device-functions.c
index 14d2d0a..263758d 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -1846,7 +1846,7 @@ int Set_EO(int channel,int mode)
int Set_Dly_Shr_Nom(int channel,int calibration_point_number)
{
- float temp1, temp2, ampl;
+ float temp1, temp2, ampl, use_pw;
Main_Rst();
Main_update_shift_registers();
@@ -1860,8 +1860,12 @@ int Set_Dly_Shr_Nom(int channel,int calibration_point_number)
}
Set_Amplitude(0,0,0,0,0,0,channel,ampl,0);
- // set to min PW, unless it is less than 20 ns
- Set_Pw(0,0,0,channel,MAX(globals.Flash.min_pw[channel],20e-9),0);
+
+ // set to PW to 20 ns, if possible
+ use_pw = MAX(globals.Flash.min_pw[channel], 20e-9);
+ use_pw = MIN(globals.Flash.max_pw[channel], use_pw);
+
+ Set_Pw(0,0,0,channel,MAX(globals.Flash.min_pw[channel],use_pw),0);
/* Set delay constants to zero, temporarily, for nulling purposes. */
/* Restore the constants after the delay is set, so that the unit */