summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-12-21 21:47:10 -0800
committerKeith Packard <keithp@keithp.com>2015-12-23 23:12:18 -0800
commit179f54b60f9e511dc664a35223d9126352ec8f15 (patch)
tree0a51580cac8d26f8ca156c3c968a87e94bed392f
parent57648595285d9c710631da18714a3f070c70baa3 (diff)
altos: Allow for pad boxes with different sensor configurations
This allows for a pad box without a resistor from power to each FET. That resistor is needed to detect welded relays, but in a solid-state system, that's not a possibility. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/drivers/ao_pad.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/drivers/ao_pad.c b/src/drivers/ao_pad.c
index e51d237b..99a90e77 100644
--- a/src/drivers/ao_pad.c
+++ b/src/drivers/ao_pad.c
@@ -155,14 +155,16 @@ ao_pad_monitor(void)
if (pyro > VOLTS_TO_PYRO(10)) {
query.arm_status = AO_PAD_ARM_STATUS_ARMED;
cur |= AO_LED_ARMED;
- } else if (pyro < VOLTS_TO_PYRO(5)) {
- query.arm_status = AO_PAD_ARM_STATUS_DISARMED;
- arm_beep_time = 0;
- } else {
+#if AO_FIRE_R_POWER_FET
+ } else if (pyro > VOLTS_TO_PYRO(5)) {
if ((ao_time() % 100) < 50)
cur |= AO_LED_ARMED;
query.arm_status = AO_PAD_ARM_STATUS_UNKNOWN;
arm_beep_time = 0;
+#endif
+ } else {
+ query.arm_status = AO_PAD_ARM_STATUS_DISARMED;
+ arm_beep_time = 0;
}
if ((ao_time() - ao_pad_packet_time) > AO_SEC_TO_TICKS(2))
cur |= AO_LED_RED;
@@ -279,8 +281,10 @@ ao_pad_read_box(void)
l = byte & 0xf;
return h * 10 + l;
}
-#else
-#define ao_pad_read_box() 0
+#endif
+
+#if HAS_FIXED_PAD_BOX
+#define ao_pad_read_box() ao_config.pad_box
#endif
#ifdef PAD_BOX