From 31185b1857685bf4bd7638a24ed19bf1c500ebf1 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 1 Jan 2000 00:00:33 +0900 Subject: try to turn output off on power fail --- instr-daemon.c | 10 +++++++--- 1 file 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