summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bus.c5
-rw-r--r--instr-daemon.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/bus.c b/bus.c
index 43de205..dfa10ba 100644
--- a/bus.c
+++ b/bus.c
@@ -356,6 +356,11 @@ void bus_init()
gpio_export(gpio_pins[i]);
gpio_changedirection(gpio_pins[i], true);
}
+
+ // FIXME: make this more elegant
+ //
+ // the POWER_FAIL pin is an input
+ gpio_changedirection(gpio_pins[POWER_FAIL], false);
}
}
diff --git a/instr-daemon.c b/instr-daemon.c
index c03236b..b7a8f7b 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -312,9 +312,8 @@ int main(int argc, char **argv)
static gboolean periodic_poll (void)
{
if (bus_getpin (POWER_FAIL)) {
+ // FIXME: system shutdown
printf ("power fail detected\n");
- } else {
- printf ("power OK\n");
}
Menu_Check_Buttons ();