From 22c7346e650ef4efb7071652c5130f5b752c868b Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 1 Jan 2000 00:15:35 +0900 Subject: further refinements to ampl settling time, but need to make it dependent on size of DAC change? --- device-functions.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/device-functions.c b/device-functions.c index 9c79d5e..a84b2cc 100644 --- a/device-functions.c +++ b/device-functions.c @@ -4760,7 +4760,7 @@ void Main_update_shift_registers() } - long sleep_us = 0; + gulong sleep_us = 0; /* keep trigger suppressed for a time (normally 0.5s) after a relay update */ if ( globals.Registers.last_relay_driver_settings[0]!=globals.Registers.shift_reg_out[2] @@ -4770,15 +4770,15 @@ void Main_update_shift_registers() } /* amplitude settling time after a change */ - if (globals.Flags.need_ampl_settling_time = YES) { + if (globals.Flags.need_ampl_settling_time == YES) { sleep_us = MAX(sleep_us, 1e6 * globals.Flash.amplitude_settling_time); } - if ((sleep_us < 0) || (sleep_us > 10e6)) { - sleep_us = 0; - } + /* limit to 5 seconds */ + sleep_us = MIN(sleep_us, 5e6); /* relay change and/or ampl settling time */ + g_print_debug("update sleep: %ld\n", sleep_us); g_usleep (sleep_us); /* restore output if required */ -- cgit