summaryrefslogtreecommitdiff
path: root/instr-daemon.c
diff options
context:
space:
mode:
authorroot <root@xena.domain.avtechpulse.com>2012-10-04 08:28:15 -0400
committerroot <root@xena.domain.avtechpulse.com>2012-10-04 08:28:15 -0400
commita0f966ce43e7286d7e033d0b17ab00d6ff6609b5 (patch)
tree171a1af32f28bf5cf52dde69fff91599af97b84b /instr-daemon.c
parentff3ecc0632fbe0671f000595604e7c1de77f33dc (diff)
wrap flash writes and shutdown sequence in flags
Diffstat (limited to 'instr-daemon.c')
-rw-r--r--instr-daemon.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/instr-daemon.c b/instr-daemon.c
index f2b9ca2..021eb62 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -317,6 +317,12 @@ static gboolean periodic_poll (void)
{
if (bus_getpin (POWER_FAIL)) {
+ globals.Flags.shutdown_started = TRUE;
+
+ while (globals.Flags.flash_write_in_progress) {
+ g_usleep(1000);
+ }
+
LCD_clear();
LCD_write(0,0,"Power failed. Shutdown.");