diff options
-rw-r--r-- | bus.c | 3 | ||||
-rw-r--r-- | bus.h | 1 | ||||
-rw-r--r-- | instr-daemon.c | 5 |
3 files changed, 8 insertions, 1 deletions
@@ -325,7 +325,8 @@ static unsigned gpio_pins[] = { GPIO0_X + 22, // i.e., GPIO0_22 GPIO0_X + 26, GPIO1_X + 15, // i.e., GPIO1_15 GPIO1_X + 14, - GPIO0_X + 27 + GPIO0_X + 27, + GPIO1_X + 12 }; @@ -18,6 +18,7 @@ #define O_GATE 3 /* gates output */ #define OUTPUT_RELAY 4 /* output enable/disable relay */ #define PW_ENABLE 5 /* TTL enable/disable output */ +#define POWER_FAIL 6 /* pulled low if +24V OK, pulled high if power fails */ // A5, A6 used to select chips #define Octal_DACportCS_low 0x00 diff --git a/instr-daemon.c b/instr-daemon.c index d749721..c03236b 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -311,6 +311,11 @@ int main(int argc, char **argv) static gboolean periodic_poll (void) { + if (bus_getpin (POWER_FAIL)) { + printf ("power fail detected\n"); + } else { + printf ("power OK\n"); + } Menu_Check_Buttons (); |