diff options
Diffstat (limited to 'instr-daemon.c')
-rw-r--r-- | instr-daemon.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index 1612e9b..38ea23e 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -392,19 +392,23 @@ static gboolean periodic_poll (void) { gboolean power_fail; - // TODO - remove Olimex qualification once ethernet-enabled carrier board is available - power_fail = globals.HWDetect.has_gpio && bus_getpin (POWER_FAIL); + power_fail = bus_getpin (POWER_FAIL); if (power_fail) { // verify after a short delay (25 ms), to ignore short power glitches g_usleep (25e3); - power_fail = (globals.HWDetect.has_gpio && bus_getpin (POWER_FAIL)); + power_fail = bus_getpin (POWER_FAIL); } if (power_fail) { globals.Sys.shutdown_started = TRUE; + int i; + for (i=0;i<max_channels;i++) { + Set_Output_State(i,output_off); + } + while (globals.Sys.flash_write_in_progress) { g_usleep(1000); } |