summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:17:11 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:17:11 -0500
commit0b7b9411b8ae3a4e3ed1f96be4b07162693ff201 (patch)
tree47f4f1a5791d8697c4cedf716d99d6dcf4c6ab8f /device-functions.c
parentfecdc9d9bc4afe780c7d0e72f3365ac7d42f3714 (diff)
when nulling delay, make PW as close to 20 ns as possible
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 */