diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-16 15:05:47 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-10-16 15:05:47 -0400 |
commit | 209deac675a4faf789b8f72de04832e4ec53f9d0 (patch) | |
tree | 30929c5c493505ed06892ea307700a606c6c6212 | |
parent | 77f8be1de24748a2abecafa8ee48b66304a441af (diff) |
enforce minimum start-up delay for splash screen
-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); } |