diff options
author | Mike <mjc@avtechpulse.com> | 2000-01-01 00:01:23 +0900 |
---|---|---|
committer | Mike <mjc@avtechpulse.com> | 2000-01-01 00:01:23 +0900 |
commit | ab742134cc5e49e7a978fbf2f592ec360d2ccee4 (patch) | |
tree | 9083ac5685b163100eee8b7830033ae5f68561b1 /instr-daemon.c | |
parent | a9ac44b3cd1f16d7ec2e14730adf6ec1d38f6cb3 (diff) |
toggle min PW module on powerup also, due to use of IL710 in PCB 340A/B
Diffstat (limited to 'instr-daemon.c')
-rw-r--r-- | instr-daemon.c | 56 |
1 files changed, 35 insertions, 21 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index 9059208..259babb 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -215,6 +215,32 @@ static void get_root_mount () return; } + +static void do_toggle_pulse (int chan, float pw) +{ + int j; + + for (j=0;j<ampl_polarities;j++) { + Set_Pw(0,0,0,chan,pw,0); + + // do each polarity + if (j == 0) { + Set_Amplitude(0,0,0,0,0,0,0,chan,smallest_allowed_number,0); + } else { + Set_Amplitude(0,0,0,0,0,0,0,chan,-smallest_allowed_number,0); + } + + Set_Trig_Source(chan,source_hold); + + // trigger IL710 twice to initialize it + Set_Output_State(chan,output_on); + Set_Trig_Source(chan,source_immediate); + Set_Trig_Source(chan,source_immediate); + Set_Output_State(chan,output_off); + } +} + + int main(int argc, char **argv) { GSocketService *service = NULL; @@ -275,29 +301,17 @@ int main(int argc, char **argv) for (i=0; i<max_channels; i++) { if (globals.Flash.toggle_trig_at_boot[i]) { - int j; - for (j=0;j<ampl_polarities;j++) { - - // 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); - - // 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); + // 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); + do_toggle_pulse (i, use_pw); - // trigger IL710 twice to initialize it - Set_Output_State(i,output_on); - Set_Trig_Source(i,source_immediate); - Set_Trig_Source(i,source_immediate); - Set_Output_State(i,output_off); + // also toggle narrow range model, if it exists + if ((use_pw > 7e-9) && (globals.Flash.min_pw[i] < 7e-9)) { + use_pw = globals.Flash.min_pw[i]; + do_toggle_pulse (i, use_pw); } } } |