diff options
| author | Keith Packard <keithp@keithp.com> | 2015-12-21 21:47:10 -0800 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2016-04-19 23:21:30 -0400 | 
| commit | 93100ae8d4c8bd8fd6bdeff2cdc87b613c5d8058 (patch) | |
| tree | 89000d854b68e6a1f44949f16b2f16a256e7b73a /src | |
| parent | f2038dd2cfed5bbf049144172e3f7436b6cd3a55 (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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/ao_pad.c | 16 | 
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 | 
