diff options
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 10 |
1 files 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 */ |