diff options
-rw-r--r-- | instr-daemon.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index cd92d26..a4265cf 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -238,8 +238,14 @@ int main(int argc, char **argv) globals.Timers.startup_timer_value = sec_timer (); long timer_count; - while ((timer_count=sec_timer()-globals.Timers.startup_timer_value) < (long)globals.Flash.turn_on_dly) { - message = g_strdup_printf ("%ld ", (long) globals.Flash.turn_on_dly - timer_count); + long on_delay = (long)globals.Flash.turn_on_dly; + + if ((on_delay < 1) || (on_delay > 120)) { + on_delay = 1; + } + + while ((timer_count=sec_timer()-globals.Timers.startup_timer_value) < on_delay) { + message = g_strdup_printf ("%ld ", on_delay - timer_count); LCD_write(3,27,message); g_free (message); } |