From: Keith Packard Date: Tue, 22 Dec 2015 05:47:10 +0000 (-0800) Subject: altos: Allow for pad boxes with different sensor configurations X-Git-Tag: 1.6.3~2^2~52 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=93100ae8d4c8bd8fd6bdeff2cdc87b613c5d8058 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 --- 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