summaryrefslogtreecommitdiff
path: root/instr-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'instr-daemon.c')
-rw-r--r--instr-daemon.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/instr-daemon.c b/instr-daemon.c
index c475589..fa16202 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -221,6 +221,8 @@ int main(int argc, char **argv)
GError *error = NULL;
GIOChannel* stdinChannel = NULL;
+ float use_pw;
+
g_type_init ();
g_thread_init (NULL);
@@ -271,14 +273,21 @@ int main(int argc, char **argv)
int j;
for (j=0;j<ampl_polarities;j++) {
- // do each polarity
- Set_Amplitude(0,j,1,0,0,0,0,i,0.0,0);
- Set_Trig_Source(i,source_hold);
+ // Set to PW to 500 ns, if possible.
+ // Wide enough to use PGC in AVR-E3-W3.
+ use_pw = MAX(globals.Flash.min_pw[i], 500e-9);
+ use_pw = MIN(globals.Flash.max_pw[i], use_pw);
+ Set_Pw(0,0,0,i,use_pw,0);
- if (globals.Flash.volt_ctrl_pw[i]) {
- Set_Use_Vctrl_PW_Range(i,FALSE);
+ // do each polarity
+ if (j == 0) {
+ Set_Amplitude(0,0,0,0,0,0,0,i,smallest_allowed_number,0);
+ } else {
+ Set_Amplitude(0,0,0,0,0,0,0,i,-smallest_allowed_number,0);
}
+ Set_Trig_Source(i,source_hold);
+
// trigger IL710 twice to initialize it
Set_Output_State(i,output_on);
Set_Trig_Source(i,source_immediate);