diff options
| author | Keith Packard <keithp@keithp.com> | 2011-07-21 20:04:05 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2011-08-27 12:45:33 -0700 | 
| commit | 4299b5a36a2f6f9f7bbbc3a1b935dd2357c1fb0f (patch) | |
| tree | 3b8adeaa02d4f54009aefa9bceafc92a88a64d65 /src/cc1111/ao_packet_master.c | |
| parent | 776df9ce2e7b4fa5cedda326988e66c614299af4 (diff) | |
altos: Implement remote launch protocol
Uses the radio_cmac module to provide secure communication.
Keeps igniter closed for 500ms.
Provides remote status for arming and ignition.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/cc1111/ao_packet_master.c')
| -rw-r--r-- | src/cc1111/ao_packet_master.c | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cc1111/ao_packet_master.c b/src/cc1111/ao_packet_master.c index b0fdf5a8..0d0be30e 100644 --- a/src/cc1111/ao_packet_master.c +++ b/src/cc1111/ao_packet_master.c @@ -80,13 +80,16 @@ ao_packet_master(void)  	ao_packet_master_time = ao_time();  	ao_packet_master_delay = AO_PACKET_MASTER_DELAY_SHORT;  	while (ao_packet_enable) { +		uint8_t	r;  		memcpy(ao_tx_packet.callsign, ao_config.callsign, AO_MAX_CALLSIGN);  		ao_packet_send();  		if (ao_tx_packet.len)  			ao_packet_master_busy();  		ao_packet_master_check_busy();  		ao_alarm(ao_packet_master_delay); -		if (ao_packet_recv()) { +		r = ao_packet_recv(); +		ao_clear_alarm(); +		if (r) {  			/* if we can transmit data, do so */  			if (ao_packet_tx_used && ao_tx_packet.len == 0)  				continue; @@ -95,6 +98,7 @@ ao_packet_master(void)  			ao_packet_master_sleeping = 1;  			ao_alarm(ao_packet_master_delay);  			ao_sleep(&ao_packet_master_sleeping); +			ao_clear_alarm();  			ao_packet_master_sleeping = 0;  		}  	}  | 
